summaryrefslogtreecommitdiffstats
path: root/fs/open.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2018-07-10 19:12:05 +0200
committerAl Viro <viro@zeniv.linux.org.uk>2018-07-12 16:04:13 +0200
commit6de37b6dc085e7c5e092b69289af66876526da44 (patch)
tree5d2519411b954eb4d97c70fb972d7b8a1fb1c635 /fs/open.c
parentalloc_file(): switch to passing O_... flags instead of FMODE_... mode (diff)
downloadlinux-6de37b6dc085e7c5e092b69289af66876526da44.tar.xz
linux-6de37b6dc085e7c5e092b69289af66876526da44.zip
pass creds to get_empty_filp(), make sure dentry_open() passes the right creds
... and rename get_empty_filp() to alloc_empty_file(). dentry_open() gets creds as argument, but the only thing that sees those is security_file_open() - file->f_cred still ends up with current_cred(). For almost all callers it's the same thing, but there are several broken cases. Acked-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/open.c')
-rw-r--r--fs/open.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/open.c b/fs/open.c
index 530da965e369..0061f9ea044d 100644
--- a/fs/open.c
+++ b/fs/open.c
@@ -921,7 +921,7 @@ struct file *dentry_open(const struct path *path, int flags,
/* We must always pass in a valid mount pointer. */
BUG_ON(!path->mnt);
- f = get_empty_filp();
+ f = alloc_empty_file(cred);
if (!IS_ERR(f)) {
f->f_flags = flags;
error = vfs_open(path, f, cred);