Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751153AbdFCGd7 (ORCPT ); Sat, 3 Jun 2017 02:33:59 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:36030 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750753AbdFCGd6 (ORCPT ); Sat, 3 Jun 2017 02:33:58 -0400 Date: Sat, 3 Jun 2017 07:33:55 +0100 From: Al Viro To: Matt Brown Cc: james.l.morris@oracle.com, serge@hallyn.com, linux-kernel@vger.kernel.org, linux-security-module@vger.kernel.org, kernel-hardening@lists.openwall.com Subject: Re: [PATCH v1 1/1] Add Trusted Path Execution as a stackable LSM Message-ID: <20170603063354.GJ6365@ZenIV.linux.org.uk> References: <20170603055351.16080-1-matt@nmatt.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170603055351.16080-1-matt@nmatt.com> User-Agent: Mutt/1.8.0 (2017-02-23) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 453 Lines: 10 On Sat, Jun 03, 2017 at 01:53:51AM -0400, Matt Brown wrote: > +static int tpe_bprm_set_creds(struct linux_binprm *bprm) > +{ > + struct file *file = bprm->file; > + struct inode *inode = d_backing_inode(file->f_path.dentry->d_parent); > + struct inode *file_inode = d_backing_inode(file->f_path.dentry); Bloody wonderful. Do tell, what *does* prevent a race with rename(2) here, somehow making sure that your 'inode' won't get freed right under you?