Commit e6ae4381 authored by Al Viro's avatar Al Viro

bprm_fill_uid(): don't open-code file_inode()

Reviewed-by: default avatarChristian Brauner (Microsoft) <brauner@kernel.org>
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 235185b8
...@@ -1595,7 +1595,7 @@ static void bprm_fill_uid(struct linux_binprm *bprm, struct file *file) ...@@ -1595,7 +1595,7 @@ static void bprm_fill_uid(struct linux_binprm *bprm, struct file *file)
{ {
/* Handle suid and sgid on files */ /* Handle suid and sgid on files */
struct user_namespace *mnt_userns; struct user_namespace *mnt_userns;
struct inode *inode; struct inode *inode = file_inode(file);
unsigned int mode; unsigned int mode;
kuid_t uid; kuid_t uid;
kgid_t gid; kgid_t gid;
...@@ -1606,7 +1606,6 @@ static void bprm_fill_uid(struct linux_binprm *bprm, struct file *file) ...@@ -1606,7 +1606,6 @@ static void bprm_fill_uid(struct linux_binprm *bprm, struct file *file)
if (task_no_new_privs(current)) if (task_no_new_privs(current))
return; return;
inode = file->f_path.dentry->d_inode;
mode = READ_ONCE(inode->i_mode); mode = READ_ONCE(inode->i_mode);
if (!(mode & (S_ISUID|S_ISGID))) if (!(mode & (S_ISUID|S_ISGID)))
return; return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment