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=-3.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no 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 000D1C18E5A for ; Tue, 10 Mar 2020 19:15:43 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id BC67821D56 for ; Tue, 10 Mar 2020 19:15:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BC67821D56 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ubuntu.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 6E9F76B006C; Tue, 10 Mar 2020 15:15:43 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 69A8F6B006E; Tue, 10 Mar 2020 15:15:43 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5AFE76B0070; Tue, 10 Mar 2020 15:15:43 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0220.hostedemail.com [216.40.44.220]) by kanga.kvack.org (Postfix) with ESMTP id 417536B006C for ; Tue, 10 Mar 2020 15:15:43 -0400 (EDT) Received: from smtpin20.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id DF68E180AD820 for ; Tue, 10 Mar 2020 19:15:42 +0000 (UTC) X-FDA: 76580406924.20.name72_6bee5f9db6f3c X-HE-Tag: name72_6bee5f9db6f3c X-Filterd-Recvd-Size: 4152 Received: from youngberry.canonical.com (youngberry.canonical.com [91.189.89.112]) by imf41.hostedemail.com (Postfix) with ESMTP for ; Tue, 10 Mar 2020 19:15:41 +0000 (UTC) Received: from ip5f5bf7ec.dynamic.kabel-deutschland.de ([95.91.247.236] helo=wittgenstein) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1jBkLJ-0000Bk-RP; Tue, 10 Mar 2020 19:15:06 +0000 Date: Tue, 10 Mar 2020 20:15:02 +0100 From: Christian Brauner To: "Eric W. Biederman" Cc: Bernd Edlinger , Kees Cook , Jann Horn , Jonathan Corbet , Alexander Viro , Andrew Morton , Alexey Dobriyan , Thomas Gleixner , Oleg Nesterov , Frederic Weisbecker , Andrei Vagin , Ingo Molnar , "Peter Zijlstra (Intel)" , Yuyang Du , David Hildenbrand , Sebastian Andrzej Siewior , Anshuman Khandual , David Howells , James Morris , Greg Kroah-Hartman , Shakeel Butt , Jason Gunthorpe , Christian Kellner , Andrea Arcangeli , Aleksa Sarai , "Dmitry V. Levin" , "linux-doc@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-fsdevel@vger.kernel.org" , "linux-mm@kvack.org" , "stable@vger.kernel.org" , "linux-api@vger.kernel.org" , Arnd Bergmann , Sargun Dhillon Subject: Re: [PATCH] pidfd: Stop taking cred_guard_mutex Message-ID: <20200310191502.qcqxfkhh5k2gxyzp@wittgenstein> References: <87tv32cxmf.fsf_-_@x220.int.ebiederm.org> <87v9ne5y4y.fsf_-_@x220.int.ebiederm.org> <87eeu25y14.fsf_-_@x220.int.ebiederm.org> <20200309195909.h2lv5uawce5wgryx@wittgenstein> <877dztz415.fsf@x220.int.ebiederm.org> <20200309201729.yk5sd26v4bz4gtou@wittgenstein> <87k13txnig.fsf@x220.int.ebiederm.org> <20200310085540.pztaty2mj62xt2nm@wittgenstein> <87wo7svy96.fsf_-_@x220.int.ebiederm.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <87wo7svy96.fsf_-_@x220.int.ebiederm.org> X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Tue, Mar 10, 2020 at 01:52:05PM -0500, Eric W. Biederman wrote: > > During exec some file descriptors are closed and the files struct is > unshared. But all of that can happen at other times and it has the > same protections during exec as at ordinary times. So stop taking the > cred_guard_mutex as it is useless. > > Furthermore he cred_guard_mutex is a bad idea because it is deadlock > prone, as it is held in serveral while waiting possibly indefinitely > for userspace to do something. > > Cc: Sargun Dhillon > Cc: Christian Brauner > Cc: Arnd Bergmann > Fixes: 8649c322f75c ("pid: Implement pidfd_getfd syscall") > Signed-off-by: "Eric W. Biederman" > --- > kernel/pid.c | 6 ------ > 1 file changed, 6 deletions(-) > > Christian if you don't have any objections I will take this one through > my tree. Sure. Acked-by: Christian Brauner > > I tried to figure out why this code path takes the cred_guard_mutex and > the archive on lore.kernel.org was not helpful in finding that part of > the conversation. Let me think a little harder and hopefully get back to you with a sensible explanation.