Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp1570234ybi; Sat, 27 Jul 2019 12:48:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqyKiPvs1a3IaVvvcUVBxIy2quDzqUTt6AKtFv+sZpSgYtR4/SPN8W93pmZoIxuGfQ+Aijr0 X-Received: by 2002:a63:194f:: with SMTP id 15mr62814897pgz.382.1564256930670; Sat, 27 Jul 2019 12:48:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564256930; cv=none; d=google.com; s=arc-20160816; b=jzr7r9sRCfEDkM1u+9meX8kBQo+E4mLoovuKjSdOTtmqvxzeO3uA+iIymVQLF8ezp8 XZnM9FXW1IK+W2WrF/ja1YNM/QRtA7hOuZ0Fg9MCVZA8XuG1+6CtwIRpcNePc3VBdFR4 AO5IOWZguzLnXNY87dcAXU2x1A3xxYQF1ak0ghfLPQIquVsqBCLBx5s13XWsOFbbH5m2 6QlysNGKK0wBrlrZgGjvbg+AF8/jRyDiwLYFDLeIctgwgAv33N5CQiUVgH5bkAWBkme9 qrtMu28hSrxToymJnyH3wxuG+82JS3JlKlG58/D/4hde+K+pbwT7kOUOhQQqMn3QoFfq B9jA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=n43qXuEr3mG1ijMb2XGbusnjU1ZIjDMamENkGkmKVxQ=; b=VrgRpP4cEUyO6dXQiqVtB5Vqk8sW3RMwDue12NP7s8txlBeHWSLC+ngp5m+1xfFuzL EuyTY/d176nsJnFvI/zb8BstXIB10ocK6ZpKSjbRIKLNQ1yeHcrlCOyAAcOVtRmqF7wx Cswr0Prmehlqxq8txMWIbB93Jx4hZmejr9ELWfwakJdsI2sJtJUM2Rf8iY8K3AW2p3v/ PEuoECfPD8t127Qks9qUofm1062Qs0MNIx8e6hzgOKK3oNGzCxkBnlGCqogJKAE1e4Jz x0FDNEaTNAWgvHTbrcdKLOGgHGqE/e78zxUpwbAK5/PkfRr7UjXN+ylISedaoOk674UC KwuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@brauner.io header.s=google header.b=UHJ2++i0; 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 x13si27784048pgf.275.2019.07.27.12.48.06; Sat, 27 Jul 2019 12:48:50 -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; dkim=pass header.i=@brauner.io header.s=google header.b=UHJ2++i0; 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 S2388228AbfG0Tqb (ORCPT + 99 others); Sat, 27 Jul 2019 15:46:31 -0400 Received: from mail-wm1-f67.google.com ([209.85.128.67]:35781 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388181AbfG0Tqb (ORCPT ); Sat, 27 Jul 2019 15:46:31 -0400 Received: by mail-wm1-f67.google.com with SMTP id l2so50219366wmg.0 for ; Sat, 27 Jul 2019 12:46:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brauner.io; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=n43qXuEr3mG1ijMb2XGbusnjU1ZIjDMamENkGkmKVxQ=; b=UHJ2++i0FDAHvtlpG67S4XkRT06ha0fBqds6o2J9t3UIRrj4x8nHPY601Hfu3liZmC ud5RdFXVxFvdipQG1/T0lyQ1UBBsgI/FpRTG+7H4+iCpwtJBqcmPCjoC0RLrklKEPG2d +RrDIBA9sPOAbQKtGpJ6IgJ0RoX3+GbayNA80VF0Eqy7Dm7KY6jGqLtC6Tln63s0cxce 4CDkiz3XhO2mAXhlWGfqArFZpRKl26aDuLDqQbEdJcKO7bIM0ZAVSRa6/hU0M+preU8p jTczSRqtJZ2dO+fAosYL+mcGjCE23P5r7TTTRBNUrvRZ9DUM7CQQD9JDt6sEyGEXS0kh C4Nw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=n43qXuEr3mG1ijMb2XGbusnjU1ZIjDMamENkGkmKVxQ=; b=SRwHFnHPkoQ3KaSi07SjzTitlbhsDvh4PkGoLzoEP6VzCbOC/HhXrdzL6SxMDA3CqU tpHdudN1lpa/eK6Yot+PA6zuwFxOa02w1fBVC28F3LljQ7tAeRtkZnlrINwztex9n/VR f1d5HMuWAKIGG7t27A7NKDFNsi/CR8YG1kVT9umwFV7fMecOyvfnyRRt4nXrRBfxqU4Q Qm4J7wWY0B0tyTeYVpAFtN8w1qGg7d2wqlzXKy45YHjM/YziwlYEwQPu2rQ0E1YXoXaX ApovniaG+z3jSSNcxF9Tvly6CFa0VI5LtCQAejjvGL+Bo3wtGRqS8b4I3XVZEp2cpubl fqIA== X-Gm-Message-State: APjAAAXGITy8jyJBRem4IMG8q7E34ppT6rXk3JiMCNIa5be01NEgwLnZ uIJdZvdoNSGkety5iEJYirg= X-Received: by 2002:a1c:f409:: with SMTP id z9mr20833366wma.176.1564256788985; Sat, 27 Jul 2019 12:46:28 -0700 (PDT) Received: from brauner.io ([213.220.153.21]) by smtp.gmail.com with ESMTPSA id l25sm43182621wme.13.2019.07.27.12.46.28 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sat, 27 Jul 2019 12:46:28 -0700 (PDT) Date: Sat, 27 Jul 2019 21:46:27 +0200 From: Christian Brauner To: Al Viro Cc: Linus Torvalds , Linux List Kernel Mailing , Oleg Nesterov , Arnd Bergmann , "Eric W. Biederman" , Kees Cook , Joel Fernandes , Thomas Gleixner , Tejun Heo , David Howells , Jann Horn , Andrew Lutomirski , Andrew Morton , Aleksa Sarai , Android Kernel Team Subject: Re: [PATCH v2 1/2] pidfd: add P_PIDFD to waitid() Message-ID: <20190727194627.ivyc4rltkfgvdhpf@brauner.io> References: <20190727085201.11743-1-christian@brauner.io> <20190727085201.11743-2-christian@brauner.io> <20190727164932.GR1131@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20190727164932.GR1131@ZenIV.linux.org.uk> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jul 27, 2019 at 05:49:32PM +0100, Al Viro wrote: > On Sat, Jul 27, 2019 at 09:28:40AM -0700, Linus Torvalds wrote: > > > is the stupid and straightforward thing, but if you want to be > > *clever* you can actually avoid getting a reference to the 'struct > > file *" entirely, and do the fd->pid lookup under rcu_read_lock() > > instead. It's slightly more complex, but it avoids the fdget/fdput > > reference count games entirely. > > Yecchhh... Please, don't do the last part - at least not unless > we really see that in profiles. Yeah, I will leave this out for now. Christian