mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
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 <[email protected]> Signed-off-by: Al Viro <[email protected]>
This commit is contained in:
parent
c9c554f214
commit
6de37b6dc0
4 changed files with 5 additions and 6 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue