summaryrefslogtreecommitdiff
path: root/fs/exec.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2022-08-20 18:46:10 +0300
committerAl Viro <viro@zeniv.linux.org.uk>2022-09-02 00:44:38 +0300
commite6ae43812460450bdb42f14c5813ac42d6bc9067 (patch)
treefb17ac99f3e3a3d07754ceec834e96d2ce2fb318 /fs/exec.c
parent235185b8ed77fd930c252b415973d9a4d50a8700 (diff)
downloadlinux-e6ae43812460450bdb42f14c5813ac42d6bc9067.tar.xz
bprm_fill_uid(): don't open-code file_inode()
Reviewed-by: Christian Brauner (Microsoft) <brauner@kernel.org> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/exec.c')
-rw-r--r--fs/exec.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/exec.c b/fs/exec.c
index f793221f4eb6..c1867122204a 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -1595,7 +1595,7 @@ static void bprm_fill_uid(struct linux_binprm *bprm, struct file *file)
{
/* Handle suid and sgid on files */
struct user_namespace *mnt_userns;
- struct inode *inode;
+ struct inode *inode = file_inode(file);
unsigned int mode;
kuid_t uid;
kgid_t gid;
@@ -1606,7 +1606,6 @@ static void bprm_fill_uid(struct linux_binprm *bprm, struct file *file)
if (task_no_new_privs(current))
return;
- inode = file->f_path.dentry->d_inode;
mode = READ_ONCE(inode->i_mode);
if (!(mode & (S_ISUID|S_ISGID)))
return;