lkml.org 
[lkml]   [2018]   [Jul]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC] call_with_creds()
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 <viro@zeniv.linux.org.uk> 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.

\
 
 \ /
  Last update: 2018-07-18 22:15    [W:0.261 / U:0.568 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site