From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Wed, 18 Jul 2018 21:15:18 +0100 From: Al Viro To: Linus Torvalds Cc: Miklos Szeredi , Stephen Rothwell , linux-fsdevel , Linux Kernel Mailing List Subject: Re: [RFC] call_with_creds() Message-ID: <20180718201518.GX30522@ZenIV.linux.org.uk> References: <20180718132955.2bf185b7@canb.auug.org.au> <20180718124340.GS30522@ZenIV.linux.org.uk> <20180718181252.GU30522@ZenIV.linux.org.uk> <20180718194637.GV30522@ZenIV.linux.org.uk> <20180718200411.GW30522@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180718200411.GW30522@ZenIV.linux.org.uk> Sender: linux-kernel-owner@vger.kernel.org List-ID: On Wed, Jul 18, 2018 at 09:04:11PM +0100, Al Viro wrote: > On Wed, Jul 18, 2018 at 12:53:48PM -0700, Linus Torvalds wrote: > > On Wed, Jul 18, 2018 at 12:46 PM Al Viro wrote: > > > > > > Huh? Nevermind ->write(), what about open()? > > > > What about open? > > > > At open time, file->f_cred is the same as current_cred(). > > int cachefiles_write_page(struct fscache_storage *op, struct page *page) > { > ... > file = dentry_open(&path, O_RDWR | O_LARGEFILE, cache->cache_cred); > > > int ecryptfs_privileged_open(struct file **lower_file, > struct dentry *lower_dentry, > struct vfsmount *lower_mnt, > const struct cred *cred) > ... > (*lower_file) = dentry_open(&req.path, flags, cred); Actually, scratch that one - in this case it is current_cred() (whether that's the right value or not). cachefile_write_page() case is for real, AFAICS.