From e6ae43812460450bdb42f14c5813ac42d6bc9067 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sat, 20 Aug 2022 11:46:10 -0400 Subject: bprm_fill_uid(): don't open-code file_inode() Reviewed-by: Christian Brauner (Microsoft) Signed-off-by: Al Viro --- fs/exec.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'fs/exec.c') 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; -- cgit v1.2.3