Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2024663pxu; Sun, 13 Dec 2020 10:58:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJw5dF+PTIiws91z4S3CsL+i2JuIuRhUGltkyLUbuMJcJDudhoLK36fVemM+MeDDRd/QZX/8 X-Received: by 2002:a17:907:971c:: with SMTP id jg28mr19700091ejc.85.1607885927005; Sun, 13 Dec 2020 10:58:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607885926; cv=none; d=google.com; s=arc-20160816; b=zf8T975u9GaKHLtB+liA2l+ziJsi3MlogRsnT4EDDK1QZgnDB2ztEj/9O3cqJn+1/l /DIZrj8GIyF/4/sbUlvyXFNA1bnv6QO/QcVqRjvhvQyGasBawx9bHxbDmj0ssuQyaL14 KGNrkVUlDnrfulC5iB2t5pbx0CmJJ30eZBS7I/DTwgoLb+MoIZdkTMQN9BQ9c6P5ssYL BDZqCYHtxaPWdDgmYz3+4D/5F+/OU2vN9sgia4abL1EKmMJql4Pg0Cuc6VExF0KE3nrw mOyCrf6bsrgi89Hf8sqQLT+a8a2ORue5ZndqSYzFYD7flIUTgQ7Y7AcY2QudusG9uSmi CTAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=QpGd12BxwDvvVIkKTTf0i1nFrqsXOgn1zGbzKOXzb2Q=; b=NdgYjisdTuifam8nUWEFSU8QkRpwQ8lxEQa0p5B0BCYd3Tlx4F3iSCkgZRhvoeHhB2 zCTCLx2DkekImgDhQh+i2J9RnotRr/xkvB4OJBNR8GitYYo206UwDchHw7we8dByYOQn 7A0jV41APHL+ql840q6JicHin7AK58X5V6ZrLwFzI4YAcusZ3i2CtbQc/SrKtlbTR1rt YkgmhMZYZYp5myqosw/S0zfjNKBL/FUirxXfXW4s2u84PjMK9+1Zxp01CjVN3NeIwe9e pYblEdhCZP8jh4aOtR4GDUEmiLgBnFD2iVBOaPxL/HpEuAC+JoxcUg7LMoMX/0hsSPDV EOVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=XOj70meh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id do19si7988723ejc.670.2020.12.13.10.58.24; Sun, 13 Dec 2020 10:58:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=XOj70meh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727484AbgLMQay (ORCPT + 99 others); Sun, 13 Dec 2020 11:30:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40570 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726166AbgLMQau (ORCPT ); Sun, 13 Dec 2020 11:30:50 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 581A3C0613CF; Sun, 13 Dec 2020 08:30:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=QpGd12BxwDvvVIkKTTf0i1nFrqsXOgn1zGbzKOXzb2Q=; b=XOj70mehMbhoTypKf/VZXqTS3L BnV1AJHZeix0ufNXHmsJ88TKAN2s8i8NQdhrMauIH2AKGYkiuFGiMNJYWQpNgJ4pXNQSkKP/2aigw oyqLBwgFRospnqUdy+alblzoDGhQExV6n1ireTuZ7JMHE+ZwPGVn1BgizDA2EYHww+Dx1vYBRfltp DwluvTXNBRIL3yx2qD5geB1+iD3azYOZapI6gvtKscIn4w8LR1Gtrhq3H9UnknR7e6p/nA5NSybqR OD4l5r/iQLq4fvAEj4tMyt1e18sJRL4/UdUoWbj6KYXLjFlWMQJRI9nVPXWJKowzkUU5teo8I+QQp fkgqKW7A==; Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1koUFh-0004AT-3i; Sun, 13 Dec 2020 16:29:41 +0000 Date: Sun, 13 Dec 2020 16:29:41 +0000 From: Matthew Wilcox To: "Eric W. Biederman" , Stephen Smalley , Casey Schaufler Cc: Stephen Brennan , Alexey Dobriyan , James Morris , "Serge E. Hallyn" , linux-security-module@vger.kernel.org, Paul Moore , Eric Paris , selinux@vger.kernel.org, Alexander Viro , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] proc: Allow pid_revalidate() during LOOKUP_RCU Message-ID: <20201213162941.GG2443@casper.infradead.org> References: <20201204000212.773032-1-stephen.s.brennan@oracle.com> <20201212205522.GF2443@casper.infradead.org> <877dpln5uf.fsf@x220.int.ebiederm.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <877dpln5uf.fsf@x220.int.ebiederm.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Dec 13, 2020 at 08:22:32AM -0600, Eric W. Biederman wrote: > Matthew Wilcox writes: > > > On Thu, Dec 03, 2020 at 04:02:12PM -0800, Stephen Brennan wrote: > >> -void pid_update_inode(struct task_struct *task, struct inode *inode) > >> +static int do_pid_update_inode(struct task_struct *task, struct inode *inode, > >> + unsigned int flags) > > > > I'm really nitpicking here, but this function only _updates_ the inode > > if flags says it should. So I was thinking something like this > > (compile tested only). > > > > I'd really appreocate feedback from someone like Casey or Stephen on > > what they need for their security modules. > > Just so we don't have security module questions confusing things > can we please make this a 2 patch series? With the first > patch removing security_task_to_inode? > > The justification for the removal is that all security_task_to_inode > appears to care about is the file type bits in inode->i_mode. Something > that never changes. Having this in a separate patch would make that > logical change easier to verify. I don't think that's right, which is why I keep asking Stephen & Casey for their thoughts. For example, * Sets the smack pointer in the inode security blob */ static void smack_task_to_inode(struct task_struct *p, struct inode *inode) { struct inode_smack *isp = smack_inode(inode); struct smack_known *skp = smk_of_task_struct(p); isp->smk_inode = skp; isp->smk_flags |= SMK_INODE_INSTANT; } That seems to do rather more than checking the file type bits.