Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3159095imu; Mon, 19 Nov 2018 11:33:46 -0800 (PST) X-Google-Smtp-Source: AJdET5fny3r8noZSynaoNi8vdE1lEUqKN+JqK99pmcp4lElbZPxyT9z2h3WVSUAeDU2L7ZJyoyJd X-Received: by 2002:a62:8145:: with SMTP id t66mr6313027pfd.55.1542656026636; Mon, 19 Nov 2018 11:33:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542656026; cv=none; d=google.com; s=arc-20160816; b=o5AsY3gXDZMBZKbuSlmgyTM4lDeuaJT0aBpxj+WdJJwbCGb8noJ+3fZv1sNW8fcrVK XujYIsygSzUhXEn8zKuQtN9ijktTqk/dtwQjkszswj4MqnPda0MUu6Otl3eRgWh6FL0F lQYiDX2VPPtYpcmtknmLwj0UPNbnA2svpyYR5LZcrHvQfMUMzyhgxDFR4HllJaoy+MvX bcltNR6xnGx41EBQTDalraeo8sYTLPZoR/+t04LbczrQr9GoqF5IfA6E5NVtwEE4wk0F vx4cjtygE8w8Gwu6joASwF2+6WHKGuKLOILJ3UM8o0YQBXobo80s1XUMt8PnBMMLO5Qh DsEQ== 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=mu6qKRf+9E/4CL62LIsiA9rAeSPSuiYJbFtGi+7TcLE=; b=ytW9cjaXpu2BJFM85JeGtPJIeqYwGuekAchh8h4ifY/33rLECi1FWAd9DJmJr9LD9d 1/n0N/RQTsH8ihMHOFjK84jsekbcGGSOmaY+cSp8U0ppncfUJUwg2BJqDDHbiXbHMPTX z8PNkHXXe6F4CYHDx28Pr1ajJQ1UcV3rxTdYEhVAJJhy36IlHyd5iOuxDvxnwGYdHEL/ x+/XG6drM6H5Edj2QbzaScyPQcWuxF0jxDbg9xlbqdl8a1rOGlbdNoLNxyUoXbAXKUm6 yUihs2AyFBP0BiYYjhTDT4JFbEdGElzG42zUsG/UIRZL7v4wPaByT8SptAS1Jr/CeJCd QOOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@brauner.io header.s=google header.b=e1ovfNl9; 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 3-v6si42766867pfd.146.2018.11.19.11.33.31; Mon, 19 Nov 2018 11:33:46 -0800 (PST) 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=e1ovfNl9; 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 S1730259AbeKTF4o (ORCPT + 99 others); Tue, 20 Nov 2018 00:56:44 -0500 Received: from mail-pg1-f195.google.com ([209.85.215.195]:33717 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726436AbeKTF4o (ORCPT ); Tue, 20 Nov 2018 00:56:44 -0500 Received: by mail-pg1-f195.google.com with SMTP id z11so11634055pgu.0 for ; Mon, 19 Nov 2018 11:31:40 -0800 (PST) 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=mu6qKRf+9E/4CL62LIsiA9rAeSPSuiYJbFtGi+7TcLE=; b=e1ovfNl9xPKyHeKUy0RoAMQx9TOwkHNmrHtEtzp1GbvW0OVFDnScgvojPTtIkeJ9s6 GIP4IrBSB/bMuIYbF2TB3xtiIDqWgl5AmmUj7rkIlOzZhzJxvMpqobR++uuIhcFe4CH5 TI3IM6jXvuqNC6ZHJGCaWe+RC1U0GkBGJso3gBzfNrhF3g+gJ3k4h0KmwooRX7LC05H7 SHdqggOm2wOQNhhhTwumZZE7j28ND28+Y3a43Sae5gb9wuZFl6GODnh4eMAINVXlt3ee BDC3JkanUS9giILXy1E7Sktnd5cMF0/R6rKYmhlbtK0V7ceru7WtUwtMv2p/jUVpZjWG CrAg== 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=mu6qKRf+9E/4CL62LIsiA9rAeSPSuiYJbFtGi+7TcLE=; b=RjXd1n3FZlqKrM82aCwMpQUraMGKgTb65xBvw32QAdmSJdJLoIXyG9UyyESY5Iga3O xiestKw9imjHHapWGmMk8Hlnd2DrkLofS3Lq4rQlHl7bV593+T8IE4jShriwDsp9B5eA vyoAQ/xMeFZQ+SBNbxG4Lu1sLUs3YPMXuVV99IwLstZrG+OQrjjqt2Lzz3AYoXMJG0gx 4GxKam1L2yIvvzKEOOVw3WQdF/8O9+WU/XUTLEz+AIa/SsMKNWgzpl6+QYveNag/RnaG UkcgmQ0rDnFPGyUGWwO4oUUKWDeBlgnsMNwbKovhnkB67I5OH/gR87g1b0grabsfU2Pt wc8Q== X-Gm-Message-State: AGRZ1gLtrM8uFSYYDRDRXBCJTAx+I+Gpa7Ho4KwrZpuu1mLdE7EmQn0k i2w2oJT8g0ek9L++qHU6xa1uxQ== X-Received: by 2002:a63:fe0a:: with SMTP id p10mr21068310pgh.265.1542655900177; Mon, 19 Nov 2018 11:31:40 -0800 (PST) Received: from brauner.io ([2404:4404:133a:4500:9d11:de0b:446c:8485]) by smtp.gmail.com with ESMTPSA id b5sm27377357pfc.150.2018.11.19.11.31.34 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 19 Nov 2018 11:31:39 -0800 (PST) Date: Mon, 19 Nov 2018 20:31:31 +0100 From: Christian Brauner To: "Eric W. Biederman" Cc: Daniel Colascione , linux-kernel , "Serge E. Hallyn" , Jann Horn , Andy Lutomirski , Andrew Morton , Oleg Nesterov , Aleksa Sarai , Al Viro , Linux FS Devel , Linux API , Tim Murray , linux-man , Kees Cook Subject: Re: [PATCH v1 2/2] signal: add procfd_signal() syscall Message-ID: <20181119193128.hv7z4j52ajrue2jr@brauner.io> References: <20181119103241.5229-1-christian@brauner.io> <20181119103241.5229-3-christian@brauner.io> <20181119182902.fadw6qiu3eepndm3@brauner.io> <87o9ak28nl.fsf@xmission.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <87o9ak28nl.fsf@xmission.com> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 19, 2018 at 01:02:06PM -0600, Eric W. Biederman wrote: > Christian Brauner writes: > > > On Mon, Nov 19, 2018 at 07:59:24AM -0800, Daniel Colascione wrote: > >> You never addressed my comment on the previous patch about your use of > > > > Sorry, that thread exploded so quickly that I might have missed it. > > > >> private_data here. Why can't you use the struct pid reference that's > >> already in the inode? > > > > If that's what people prefer we can probably use that. There was > > precedent for stashing away such data in fs/proc/base.c already for > > various other things including user namespaces and struct mm so I > > followed this model. A prior version of my patch (I didn't send out) did > > retrive the inode via proc_pid() in .open() took an additional reference > > via get_pid() and dropped it in .release(). Do we prefer that? > > If you are using proc// directories as your file descriptors, you > don't need to add an open or a release method at all. The existing file > descriptors hold a reference to the inode which holds a reference the > the struct pid. > > The only time you need to get a reference is when you need a task > and kill_pid_info already performs that work for you. Oh, I see what you and Andy are saying now. Sweet, that means we can trim down the patch even more. Less code, less headache. Thanks! > > So using proc_pid is all you need to do to get the pid from the existing > file descriptors. > > Eric >