Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 571b7554 authored by Weston Andros Adamson's avatar Weston Andros Adamson Committed by Trond Myklebust
Browse files

NFS: dont allow minorversion= opt when vers != 4



Don't allow invalid 'vers' and 'minorversion' combinations in mount options,
such as "vers=3,minorversion=1".

Signed-off-by: default avatarWeston Andros Adamson <dros@netapp.com>
Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent 2f09c242
Loading
Loading
Loading
Loading
+7 −0
Original line number Original line Diff line number Diff line
@@ -1531,6 +1531,9 @@ static int nfs_parse_mount_options(char *raw,
	if (!sloppy && invalid_option)
	if (!sloppy && invalid_option)
		return 0;
		return 0;


	if (mnt->minorversion && mnt->version != 4)
		goto out_minorversion_mismatch;

	/*
	/*
	 * verify that any proto=/mountproto= options match the address
	 * verify that any proto=/mountproto= options match the address
	 * familiies in the addr=/mountaddr= options.
	 * familiies in the addr=/mountaddr= options.
@@ -1564,6 +1567,10 @@ out_invalid_address:
out_invalid_value:
out_invalid_value:
	printk(KERN_INFO "NFS: bad mount option value specified: %s\n", p);
	printk(KERN_INFO "NFS: bad mount option value specified: %s\n", p);
	return 0;
	return 0;
out_minorversion_mismatch:
	printk(KERN_INFO "NFS: mount option vers=%u does not support "
			 "minorversion=%u\n", mnt->version, mnt->minorversion);
	return 0;
out_nomem:
out_nomem:
	printk(KERN_INFO "NFS: not enough memory to parse option\n");
	printk(KERN_INFO "NFS: not enough memory to parse option\n");
	return 0;
	return 0;