aboutsummaryrefslogtreecommitdiffstats
path: root/fs/fs_parser.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2019-11-15 10:30:50 +0100
committerThomas Gleixner <tglx@linutronix.de>2019-11-15 10:30:50 +0100
commitac94be498f84f7327533b62faca4c3da64434904 (patch)
tree63893f37afb67cd400bf60ec16a35440d16f2a90 /fs/fs_parser.c
parentx86/hyperv: Allow guests to enable InvariantTSC (diff)
parentMerge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm (diff)
downloadlinux-dev-ac94be498f84f7327533b62faca4c3da64434904.tar.xz
linux-dev-ac94be498f84f7327533b62faca4c3da64434904.zip
Merge branch 'linus' into x86/hyperv
Pick up upstream fixes to avoid conflicts.
Diffstat (limited to 'fs/fs_parser.c')
-rw-r--r--fs/fs_parser.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/fs/fs_parser.c b/fs/fs_parser.c
index 460ea4206fa2..d1930adce68d 100644
--- a/fs/fs_parser.c
+++ b/fs/fs_parser.c
@@ -204,9 +204,23 @@ int fs_parse(struct fs_context *fc,
goto okay;
case fs_param_is_fd: {
- if (param->type != fs_value_is_file)
+ switch (param->type) {
+ case fs_value_is_string:
+ if (!result->has_value)
+ goto bad_value;
+
+ ret = kstrtouint(param->string, 0, &result->uint_32);
+ break;
+ case fs_value_is_file:
+ result->uint_32 = param->dirfd;
+ ret = 0;
+ default:
goto bad_value;
- goto okay;
+ }
+
+ if (result->uint_32 > INT_MAX)
+ goto bad_value;
+ goto maybe_okay;
}
case fs_param_is_blockdev: