Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3165753imu; Mon, 19 Nov 2018 11:41:21 -0800 (PST) X-Google-Smtp-Source: AJdET5fNzs0ffoc+yh1vN+D7F5+PRRAk2h0FuD7gbmpaoXg+1zbCWMIBiDNYOMUfIVz4mOS6DSb6 X-Received: by 2002:aa7:85d7:: with SMTP id z23mr10732946pfn.205.1542656481482; Mon, 19 Nov 2018 11:41:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542656481; cv=none; d=google.com; s=arc-20160816; b=HeIqk2S4DmKd0w0z493EUKFOf5JLIeYeRZAOQhc87BtNvnudl/smZ4jy55drCJ1gCy yR8vOB9P+TVvHz0OOdl3zLv6uE6jisgO9fEqKDeC5nZM4qh+usMlkJWQ7KevN9qWMMRB JfB048j8sdwGaoUqD2tesnXjW5OhKNOQFDLcOGLktbcbLP1BUibanPzrcG8aqJNrxf2B K0tvexr2kSY6E47ozFduoA6G7i4I/Torq1rxk0/He5bwGLBxO/Xj8YrV3wP/FqBlyipo 7+bj9WV9aQE8sbzjTPEIIPog/ZU3OfFDL/v8MpvbopeDADdoAXd6doB1M2GBZm2vDoYn +QQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature; bh=9xsZE38xTUYiZ4BKZgkLAGyvdXvx5lZL/HRMO8epTiU=; b=CJXrSXW5x1F6D9LJEmFeCfKzfckuaFdVjZQFyekhKQd3+Uff33f1DCtsCvnIQbBnd/ LK6BGFwOHSmxjcEZBkBGsywZV8127Rv2BuikyAOMUXGqIiSFf9/z1+O/TebjQsYJmnn+ a/4gliY0da9LC9srjWls9eMyzhlduxLn1nYG1Ryavwr3SIPsbTZ/STcCdbO5Q+8lwqXr MLrd+Rj6teMMYcywHn9oKETWT7Kv/5+AMR8VN6pWIbOX7l7qFaaZeHnhm6oBOEx9L8U+ yJE5e5la0wpNE2PRfn6MgYWbpzpPJgTDAbSJW333SNoCY/FJA5cZ0FJzFSPnVaBOuiqd e8Rw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=btvBDjJI; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a59-v6si38773531plc.48.2018.11.19.11.41.06; Mon, 19 Nov 2018 11:41:21 -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=@google.com header.s=20161025 header.b=btvBDjJI; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730302AbeKTGFB (ORCPT + 99 others); Tue, 20 Nov 2018 01:05:01 -0500 Received: from mail-ua1-f67.google.com ([209.85.222.67]:33430 "EHLO mail-ua1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730062AbeKTGFB (ORCPT ); Tue, 20 Nov 2018 01:05:01 -0500 Received: by mail-ua1-f67.google.com with SMTP id t8so3425027uap.0 for ; Mon, 19 Nov 2018 11:39:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=9xsZE38xTUYiZ4BKZgkLAGyvdXvx5lZL/HRMO8epTiU=; b=btvBDjJICEVVHuTSGDLx9vnFm+1QxyVLRKFe9qu5rh+AYmkRrjfKO0OzE1g770M5K0 tENUnZmpfV4lwrHU7ElPcqPKqlYVPARvAnJleqvvDiBD7gEJ/g2LY7HUcI1BPz1ixp+w l1spdoWo2C5eXljl97ogYVtDp27ttOUDuwvAE6Ma6p9HZ4hVAyD68Qpyy3bZQUTfhW65 2pqb+XMehSaKqm0f0DGX1rQYuyltIlqraD92j0yAuxllfw2ikqrp88eCkSbfWMHCm/Rh 9q4YKA+jXHZVI6dL8bwvS46yhAOwGA//dJJ0S3ToR4SNHYnkoOUAsg6jJ/XOwWHy/ern aMNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=9xsZE38xTUYiZ4BKZgkLAGyvdXvx5lZL/HRMO8epTiU=; b=ga+XrbPnCwBP3N4cCCbwWNDVMKJay8pmPACsT85HggK81sPf0h/cT9ab6DaQtg/rS6 DPHdVlmJMGOsBRcPYnita7MK6GwV/fuhVM8PezlNcgspEMxMTAI10SOA3RhbqIUTeyJR nsKlP/KVAmViL3wmU3CGlZKi4sdVh4xoJAXK53GvUbsjSG/ncTntahWo7qBdaUtmasp8 pkCDkxMJ5yt/T9SxHOVxP6avZt/lAh2xH9msOlYr+IO0TBbE2gvyqOro+Y2EjAwVFjQ+ +HUVQ7S6xhoJaWJ4xVnhUoDdVSc0qnBPFFbr8vzSAq5L5Q6lZTcXLrIvqmx2KnMJ3o32 ks+g== X-Gm-Message-State: AGRZ1gLz8EN4Sc5pKFYY9/80O6sNvQKDj1IfKdldg7ssWvCKBRfN0GYW oOVqwNiPxlDbT+537bKO50Y5LQCT5LKRIl3I8+aezg== X-Received: by 2002:ab0:225a:: with SMTP id z26mr10672112uan.100.1542656394542; Mon, 19 Nov 2018 11:39:54 -0800 (PST) MIME-Version: 1.0 Received: by 2002:a67:f48d:0:0:0:0:0 with HTTP; Mon, 19 Nov 2018 11:39:53 -0800 (PST) In-Reply-To: <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> <20181119193128.hv7z4j52ajrue2jr@brauner.io> From: Daniel Colascione Date: Mon, 19 Nov 2018 11:39:53 -0800 Message-ID: Subject: Re: [PATCH v1 2/2] signal: add procfd_signal() syscall To: Christian Brauner Cc: "Eric W. Biederman" , 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 Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Yep. That's also what I was talking about, FWIW. On Mon, Nov 19, 2018 at 11:31 AM, Christian Brauner wrote: > 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 >>