aboutsummaryrefslogtreecommitdiffstats
path: root/fs/fat/inode.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/fat/inode.c')
-rw-r--r--fs/fat/inode.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/fs/fat/inode.c b/fs/fat/inode.c
index 05e897fe9866..47d9eb0be886 100644
--- a/fs/fat/inode.c
+++ b/fs/fat/inode.c
@@ -791,10 +791,12 @@ static int fat_show_options(struct seq_file *m, struct dentry *root)
791 struct fat_mount_options *opts = &sbi->options; 791 struct fat_mount_options *opts = &sbi->options;
792 int isvfat = opts->isvfat; 792 int isvfat = opts->isvfat;
793 793
794 if (opts->fs_uid != 0) 794 if (!uid_eq(opts->fs_uid, GLOBAL_ROOT_UID))
795 seq_printf(m, ",uid=%u", opts->fs_uid); 795 seq_printf(m, ",uid=%u",
796 if (opts->fs_gid != 0) 796 from_kuid_munged(&init_user_ns, opts->fs_uid));
797 seq_printf(m, ",gid=%u", opts->fs_gid); 797 if (!gid_eq(opts->fs_gid, GLOBAL_ROOT_GID))
798 seq_printf(m, ",gid=%u",
799 from_kgid_munged(&init_user_ns, opts->fs_gid));
798 seq_printf(m, ",fmask=%04o", opts->fs_fmask); 800 seq_printf(m, ",fmask=%04o", opts->fs_fmask);
799 seq_printf(m, ",dmask=%04o", opts->fs_dmask); 801 seq_printf(m, ",dmask=%04o", opts->fs_dmask);
800 if (opts->allow_utime) 802 if (opts->allow_utime)
@@ -1037,12 +1039,16 @@ static int parse_options(struct super_block *sb, char *options, int is_vfat,
1037 case Opt_uid: 1039 case Opt_uid:
1038 if (match_int(&args[0], &option)) 1040 if (match_int(&args[0], &option))
1039 return 0; 1041 return 0;
1040 opts->fs_uid = option; 1042 opts->fs_uid = make_kuid(current_user_ns(), option);
1043 if (!uid_valid(opts->fs_uid))
1044 return 0;
1041 break; 1045 break;
1042 case Opt_gid: 1046 case Opt_gid:
1043 if (match_int(&args[0], &option)) 1047 if (match_int(&args[0], &option))
1044 return 0; 1048 return 0;
1045 opts->fs_gid = option; 1049 opts->fs_gid = make_kgid(current_user_ns(), option);
1050 if (!gid_valid(opts->fs_gid))
1051 return 0;
1046 break; 1052 break;
1047 case Opt_umask: 1053 case Opt_umask:
1048 if (match_octal(&args[0], &option)) 1054 if (match_octal(&args[0], &option))