Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp991613ybh; Tue, 10 Mar 2020 12:17:14 -0700 (PDT) X-Google-Smtp-Source: ADFU+vum2ksBk3LCPZgX23u1hoQ7puyw6MIqnivc06GUGI0cPjKvN1b9laclVx+XkQmcCYzcZBfN X-Received: by 2002:a9d:1a2:: with SMTP id e31mr3481028ote.30.1583867834739; Tue, 10 Mar 2020 12:17:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583867834; cv=none; d=google.com; s=arc-20160816; b=UFvO2/EKLz4FIb2E5MGSXR8FOqWVrh5hI+ZYr/p83KzwGqzsCsc+q4Un1QUhEd96nl JIIqurIBxX0WmyOTGlnVRq9tZrNgQz5QkjKnzGxqmfyGIG50DUNeRBVtt/kUB0hRpPTd eHfOFMOBGM5BxYlzIeKuwfzDgVQRiU5CWAh2y5CiqWnLg3RxJ4TSjOzFdRdBd6W1JqBb PKB6akWcuexcLJkhMinzX2Asr9g8Gsc/89tJEaNmD5L7e6K/GWZJevsUcokDFpmjvySt Yx1LjhZcA3T0hgHsnsS3PDuVISYU0M+CwBJgrJN7qk7onKsvcRIBQ7m3EVG9L6ACMjoS DfzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=StYdczt5BT2zif/V6WnDPIFAAPhrIlMv26VlX2wCXUM=; b=CCn0wmEP1C36AEMzOIXbT/a2QnocXF7XVfhqsmREVFC85kIahxv24IwhOj6C+6ydDg vrpAySLBEyi8OxwlfqYeesWfodv9im8zTXXsD23E1KzYbJxLshbKxhNp0ameBvft6eHs iXM+hcuQgdjwP49ikoS+lPJmo6j60BTz0XmCrwXHd6PeCzTLJsEvQPm/ro80Vfo5+lq1 2KMWfmwJjQvA1buq9BcwqYQzHD8/9mhgYX7JWa2ldQ/uF2W3G9r6noKl5nkz4BaPEKaF jQxqLuQaknoVP1b4lag7QI22nL+2epZzV12dvv1xgXx3Lox0KfNP1Loq9gkl/l7RplDe kAMw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 193si6137986oie.51.2020.03.10.12.17.01; Tue, 10 Mar 2020 12:17:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727220AbgCJTPm (ORCPT + 99 others); Tue, 10 Mar 2020 15:15:42 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:55079 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726497AbgCJTPl (ORCPT ); Tue, 10 Mar 2020 15:15:41 -0400 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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.