summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2013-08-07 12:30:52 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2013-08-07 12:37:04 -0400
commit6da1a034362f86e157e251e65394f0b6570e3e3a (patch)
treef8fa747e0efdd4dca2c94c219c62e8265a51d76a /fs
parent9597c13b2f3c54240b1b902a677672faa70ab7c5 (diff)
NFSv4: Refuse mount attempts with proto=udp
RFC3530 disallows the use of udp as a transport protocol for NFSv4. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/nfs/super.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/fs/nfs/super.c b/fs/nfs/super.c
index 71fdc0dfa0d2..f2071d221c77 100644
--- a/fs/nfs/super.c
+++ b/fs/nfs/super.c
@@ -2084,6 +2084,8 @@ static int nfs_validate_text_mount_data(void *options,
2084 max_namelen = NFS4_MAXNAMLEN; 2084 max_namelen = NFS4_MAXNAMLEN;
2085 max_pathlen = NFS4_MAXPATHLEN; 2085 max_pathlen = NFS4_MAXPATHLEN;
2086 nfs_validate_transport_protocol(args); 2086 nfs_validate_transport_protocol(args);
2087 if (args->nfs_server.protocol == XPRT_TRANSPORT_UDP)
2088 goto out_invalid_transport_udp;
2087 nfs4_validate_mount_flags(args); 2089 nfs4_validate_mount_flags(args);
2088#else 2090#else
2089 goto out_v4_not_compiled; 2091 goto out_v4_not_compiled;
@@ -2106,6 +2108,10 @@ static int nfs_validate_text_mount_data(void *options,
2106out_v4_not_compiled: 2108out_v4_not_compiled:
2107 dfprintk(MOUNT, "NFS: NFSv4 is not compiled into kernel\n"); 2109 dfprintk(MOUNT, "NFS: NFSv4 is not compiled into kernel\n");
2108 return -EPROTONOSUPPORT; 2110 return -EPROTONOSUPPORT;
2111#else
2112out_invalid_transport_udp:
2113 dfprintk(MOUNT, "NFSv4: Unsupported transport protocol udp\n");
2114 return -EINVAL;
2109#endif /* !CONFIG_NFS_V4 */ 2115#endif /* !CONFIG_NFS_V4 */
2110 2116
2111out_no_address: 2117out_no_address:
@@ -2711,6 +2717,8 @@ static int nfs4_validate_mount_data(void *options,
2711 args->acdirmax = data->acdirmax; 2717 args->acdirmax = data->acdirmax;
2712 args->nfs_server.protocol = data->proto; 2718 args->nfs_server.protocol = data->proto;
2713 nfs_validate_transport_protocol(args); 2719 nfs_validate_transport_protocol(args);
2720 if (args->nfs_server.protocol == XPRT_TRANSPORT_UDP)
2721 goto out_invalid_transport_udp;
2714 2722
2715 break; 2723 break;
2716 default: 2724 default:
@@ -2731,6 +2739,10 @@ out_inval_auth:
2731out_no_address: 2739out_no_address:
2732 dfprintk(MOUNT, "NFS4: mount program didn't pass remote address\n"); 2740 dfprintk(MOUNT, "NFS4: mount program didn't pass remote address\n");
2733 return -EINVAL; 2741 return -EINVAL;
2742
2743out_invalid_transport_udp:
2744 dfprintk(MOUNT, "NFSv4: Unsupported transport protocol udp\n");
2745 return -EINVAL;
2734} 2746}
2735 2747
2736/* 2748/*