浏览代码

NFSv4: Disallow 'mount -t nfs4 -overs=2' and 'mount -t nfs4 -overs=3'

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Trond Myklebust 15 年之前
父节点
当前提交
2ecda72b49
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. 6 0
      fs/nfs/super.c

+ 6 - 0
fs/nfs/super.c

@@ -2321,6 +2321,12 @@ static int nfs4_validate_text_mount_data(void *options,
 
 	nfs4_validate_mount_flags(args);
 
+	if (args->version != 4) {
+		dfprintk(MOUNT,
+			 "NFS4: Illegal mount version\n");
+		return -EINVAL;
+	}
+
 	if (args->auth_flavor_len > 1) {
 		dfprintk(MOUNT,
 			 "NFS4: Too many RPC auth flavours specified\n");