fs: port i_{g,u}id_into_vfs{g,u}id() to mnt_idmap
[platform/kernel/linux-starfive.git] / fs / exec.c
index c627814..3d2b80d 100644 (file)
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -1596,7 +1596,7 @@ static void check_unsafe_exec(struct linux_binprm *bprm)
 static void bprm_fill_uid(struct linux_binprm *bprm, struct file *file)
 {
        /* Handle suid and sgid on files */
-       struct user_namespace *mnt_userns;
+       struct mnt_idmap *idmap;
        struct inode *inode = file_inode(file);
        unsigned int mode;
        vfsuid_t vfsuid;
@@ -1612,15 +1612,15 @@ static void bprm_fill_uid(struct linux_binprm *bprm, struct file *file)
        if (!(mode & (S_ISUID|S_ISGID)))
                return;
 
-       mnt_userns = file_mnt_user_ns(file);
+       idmap = file_mnt_idmap(file);
 
        /* Be careful if suid/sgid is set */
        inode_lock(inode);
 
        /* reload atomically mode/uid/gid now that lock held */
        mode = inode->i_mode;
-       vfsuid = i_uid_into_vfsuid(mnt_userns, inode);
-       vfsgid = i_gid_into_vfsgid(mnt_userns, inode);
+       vfsuid = i_uid_into_vfsuid(idmap, inode);
+       vfsgid = i_gid_into_vfsgid(idmap, inode);
        inode_unlock(inode);
 
        /* We ignore suid/sgid if there are no mappings for them in the ns */