diff options
author | J. Bruce Fields <bfields@redhat.com> | 2013-01-23 23:25:01 (GMT) |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2013-01-23 23:25:01 (GMT) |
commit | ff89be87c70247ffe3a72271e02eb7765cdd12c4 (patch) | |
tree | d089d9e8fb4eae00fcbb41a4e6727267063a754c /fs/nfsd/nfsctl.c | |
parent | bca0ec6511bb96bcb6cb247fd4100a4ea1d1e4f5 (diff) | |
download | linux-fsl-qoriq-ff89be87c70247ffe3a72271e02eb7765cdd12c4.tar.xz |
nfsd4: require version 4 when enabling or disabling minorversion
The current code will allow silly things like:
echo "+2 +3 +4 +7.1">/proc/fs/nfsd/versions
Reported-by: Fan Chaoting <fanchaoting@cn.fujitsu.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd/nfsctl.c')
-rw-r--r-- | fs/nfsd/nfsctl.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c index 7493428..65889ec 100644 --- a/fs/nfsd/nfsctl.c +++ b/fs/nfsd/nfsctl.c @@ -534,7 +534,7 @@ static ssize_t __write_versions(struct file *file, char *buf, size_t size) else num = simple_strtol(vers, &minorp, 0); if (*minorp == '.') { - if (num < 4) + if (num != 4) return -EINVAL; minor = simple_strtoul(minorp+1, NULL, 0); if (minor == 0) |