From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 57BD7C2D0E4 for ; Mon, 23 Nov 2020 17:52:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DF70320758 for ; Mon, 23 Nov 2020 17:52:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="YctCtNJ/" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390459AbgKWRwG (ORCPT ); Mon, 23 Nov 2020 12:52:06 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:51273 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388615AbgKWRwG (ORCPT ); Mon, 23 Nov 2020 12:52:06 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606153925; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=KcwBDkt/6ndC1qadY8x0l7MPyKKcaJEtF94aWvQSDKM=; b=YctCtNJ/mZB4HJKZT5m6XccZiHGc5jixQVdTJNXTv+BXPOqcXMe9MRnKyfWSqb+yYi6eeH ZdaEBVKFcYTRJAuU05NNyOSM9j0kQuKMIt6SDzBJHlx92hyFdjRJPw2181XQgUp966/yiq K/4gZEyCuAzAd3Z3ebSnBzvYBtDNWuU= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-483-1MKVZVqrOMKyYKday_IbDw-1; Mon, 23 Nov 2020 12:51:04 -0500 X-MC-Unique: 1MKVZVqrOMKyYKday_IbDw-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B60AD8145E6; Mon, 23 Nov 2020 17:51:00 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.40.192.134]) by smtp.corp.redhat.com (Postfix) with SMTP id 9452C19D9F; Mon, 23 Nov 2020 17:50:54 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Mon, 23 Nov 2020 18:51:00 +0100 (CET) Date: Mon, 23 Nov 2020 18:50:53 +0100 From: Oleg Nesterov To: "Eric W. Biederman" Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, criu@openvz.org, bpf@vger.kernel.org, Linus Torvalds , Alexander Viro , Christian Brauner , Cyrill Gorcunov , Jann Horn , Kees Cook , Daniel P =?iso-8859-1?Q?=2E_Berrang=E9?= , Jeff Layton , Miklos Szeredi , Matthew Wilcox , "J. Bruce Fields" , Trond Myklebust , Chris Wright , Alexei Starovoitov , Daniel Borkmann , Martin KaFai Lau , Song Liu , Yonghong Song , Andrii Nakryiko , John Fastabend , KP Singh Subject: Re: [PATCH v2 02/24] exec: Simplify unshare_files Message-ID: <20201123175052.GA20279@redhat.com> References: <87r1on1v62.fsf@x220.int.ebiederm.org> <20201120231441.29911-2-ebiederm@xmission.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201120231441.29911-2-ebiederm@xmission.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org I'll try to actually read this series tomorrow but I see nothing wrong after the quick glance. Just one off-topic question, On 11/20, Eric W. Biederman wrote: > > --- a/fs/coredump.c > +++ b/fs/coredump.c > @@ -585,7 +585,6 @@ void do_coredump(const kernel_siginfo_t *siginfo) > int ispipe; > size_t *argv = NULL; > int argc = 0; > - struct files_struct *displaced; > /* require nonrelative corefile path and be extra careful */ > bool need_suid_safe = false; > bool core_dumped = false; > @@ -791,11 +790,9 @@ void do_coredump(const kernel_siginfo_t *siginfo) > } > > /* get us an unshared descriptor table; almost always a no-op */ > - retval = unshare_files(&displaced); > + retval = unshare_files(); Can anyone explain why does do_coredump() need unshare_files() at all? Oleg.