mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-24 14:07:52 -04:00
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>
This commit is contained in:
parent
235185b8ed
commit
e6ae438124
1 changed files with 1 additions and 2 deletions
|
@ -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)
|
||||||
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;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue