Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3127604imu; Mon, 19 Nov 2018 11:03:16 -0800 (PST) X-Google-Smtp-Source: AJdET5evbZdZfs27VpM19TrTsAuuWplzNxTsbwUjgGUGN+KOGRs/k6dO1/2EL80Co0gK+lqfKTJA X-Received: by 2002:a17:902:9a47:: with SMTP id x7-v6mr23595297plv.316.1542654196792; Mon, 19 Nov 2018 11:03:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542654196; cv=none; d=google.com; s=arc-20160816; b=iEVO7zUOHtuSAqYnR95dDJkWYNnu8xtD3YOxF+MKAdKZDjEn2q7kXc3mtHV9dKArYU 3DcVhfIuH3WfroQCDFMrDtgmIgaZaQWCfc1P65EHhIr+49DEVs/w2NvhcmBOycHDeajb lHM0GYsWt4E5ObBhIOVOvR7+N3jIe3gbDOb+jUEkUPVVrmDF/ePIisKTbWDxZ48JB9fF 6j04r6qAlz9qCeYtmKs8+cnkw9qq8xhbHjlEthbi8oPEnRexTC7GYDE9K2Rudp1UWFoA J2yYeFuqwtBpZCWgu7rVKmmb3h8NEnZZRGCyAXR1+JWXIs3/5h2eu5pBJBZtpTOg0yjI Mf4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:subject:mime-version:user-agent :message-id:in-reply-to:date:references:cc:to:from; bh=XptGhsVwMYeMfBk1nRYnyG6acTm7nwnfLp3+7Z4MX5E=; b=mvcP2nxCnfF9bdF9rCMGJynyilx0p8JWaQiTdnsTy9gts2lzwJ7piHLohnJHOv33Yp Q+O0gyK3Izq/fIRoKy/pMbQyb4uNDIe90wq9LQzSaScYhx96j56PpzoUfs3QlBRWt4DA yCVF74UmSkpiovoSQoC/Bf+BjdW++Juo1PmN1qzZeqrE+ZZcKTS2Ni5ZrKvrysy8xafs BvgM9DphtdKbKVZgq37dtx7LuKCPEmcObtv5MLxgrrQ+NLLV/IO5J+4EPQAd1PplsiI5 skihshCNXL7ISqH/Rp5hkrp2fq45MgN5mf3rU9hmmfggoUOaSaJqqcZSA8rsHXYcLa4O U9+w== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=xmission.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c2-v6si41605690plb.123.2018.11.19.11.02.55; Mon, 19 Nov 2018 11:03:16 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=xmission.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726549AbeKTF1M (ORCPT + 99 others); Tue, 20 Nov 2018 00:27:12 -0500 Received: from out01.mta.xmission.com ([166.70.13.231]:52570 "EHLO out01.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725969AbeKTF1M (ORCPT ); Tue, 20 Nov 2018 00:27:12 -0500 Received: from in01.mta.xmission.com ([166.70.13.51]) by out01.mta.xmission.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.87) (envelope-from ) id 1gOooJ-0008VP-6i; Mon, 19 Nov 2018 12:02:15 -0700 Received: from 67-3-154-154.omah.qwest.net ([67.3.154.154] helo=x220.xmission.com) by in01.mta.xmission.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.87) (envelope-from ) id 1gOooH-0004yY-LG; Mon, 19 Nov 2018 12:02:14 -0700 From: ebiederm@xmission.com (Eric W. Biederman) To: Christian Brauner 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 References: <20181119103241.5229-1-christian@brauner.io> <20181119103241.5229-3-christian@brauner.io> <20181119182902.fadw6qiu3eepndm3@brauner.io> Date: Mon, 19 Nov 2018 13:02:06 -0600 In-Reply-To: <20181119182902.fadw6qiu3eepndm3@brauner.io> (Christian Brauner's message of "Mon, 19 Nov 2018 19:29:05 +0100") Message-ID: <87o9ak28nl.fsf@xmission.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-XM-SPF: eid=1gOooH-0004yY-LG;;;mid=<87o9ak28nl.fsf@xmission.com>;;;hst=in01.mta.xmission.com;;;ip=67.3.154.154;;;frm=ebiederm@xmission.com;;;spf=neutral X-XM-AID: U2FsdGVkX1/IAgxHXFWsW3kF6a7EpuFZNuQYr3Siskc= X-SA-Exim-Connect-IP: 67.3.154.154 X-SA-Exim-Mail-From: ebiederm@xmission.com X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on sa01.xmission.com X-Spam-Level: X-Spam-Status: No, score=-0.2 required=8.0 tests=ALL_TRUSTED,BAYES_50, DCC_CHECK_NEGATIVE,TVD_RCVD_IP,T_TM2_M_HEADER_IN_MSG,T_TooManySym_01, T_TooManySym_02,T_TooManySym_03 autolearn=disabled version=3.4.0 X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * 0.8 BAYES_50 BODY: Bayes spam probability is 40 to 60% * [score: 0.5000] * 0.0 TVD_RCVD_IP Message was received from an IP address * 0.0 T_TM2_M_HEADER_IN_MSG BODY: No description available. * -0.0 DCC_CHECK_NEGATIVE Not listed in DCC * [sa01 1397; Body=1 Fuz1=1 Fuz2=1] * 0.0 T_TooManySym_02 5+ unique symbols in subject * 0.0 T_TooManySym_01 4+ unique symbols in subject * 0.0 T_TooManySym_03 6+ unique symbols in subject X-Spam-DCC: XMission; sa01 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: ;Christian Brauner X-Spam-Relay-Country: X-Spam-Timing: total 815 ms - load_scoreonly_sql: 0.06 (0.0%), signal_user_changed: 3.0 (0.4%), b_tie_ro: 1.95 (0.2%), parse: 1.40 (0.2%), extract_message_metadata: 68 (8.3%), get_uri_detail_list: 10 (1.2%), tests_pri_-1000: 46 (5.6%), tests_pri_-950: 2.1 (0.3%), tests_pri_-900: 14 (1.7%), tests_pri_-90: 76 (9.3%), check_bayes: 72 (8.9%), b_tokenize: 12 (1.5%), b_tok_get_all: 27 (3.3%), b_comp_prob: 4.1 (0.5%), b_tok_touch_all: 17 (2.1%), b_finish: 0.83 (0.1%), tests_pri_0: 573 (70.3%), check_dkim_signature: 0.82 (0.1%), check_dkim_adsp: 4.8 (0.6%), tests_pri_10: 3.8 (0.5%), tests_pri_500: 22 (2.6%), rewrite_mail: 0.00 (0.0%) Subject: Re: [PATCH v1 2/2] signal: add procfd_signal() syscall X-Spam-Flag: No X-SA-Exim-Version: 4.2.1 (built Thu, 05 May 2016 13:38:54 -0600) X-SA-Exim-Scanned: Yes (on in01.mta.xmission.com) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. So using proc_pid is all you need to do to get the pid from the existing file descriptors. Eric