NFS: Verify server address before invoking in-kernel mount client
Subsystems (2)
PATCH 2/7 NFS: Verify server address before invoking in-kernel mount client
Re-order mount option sanity checking slightly to ensure we have a valid server address *before* trying to do the mountd RPC call.
Signed-off-by Chuck Lever <[email protected]>
---
fs/nfs/super.c | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-)
fs/nfs/super.c +8 -4
@@ -1098,6 +1098,10 @@ static int nfs_validate_mount_data(void *options,if (mntfh->size <sizeof (mntfh->data))memset (mntfh->data + mntfh->size,0 ,sizeof (mntfh->data) - mntfh->size); + +if (!nfs_verify_server_address ((struct sockaddr *) &data->addr)) + goto out_no_address; +/* * Translate to nfs_parsed_mount_data, which nfs_fill_super * can deal with.
@@ -1129,6 +1133,10 @@ static int nfs_validate_mount_data(void *options,if (nfs_parse_mount_options ((char *)options, args) ==0 )return -EINVAL ; +if (!nfs_verify_server_address ((struct sockaddr *) + &args->nfs_server.address)) + goto out_no_address; + c =strchr (dev_name,':' );if (c ==NULL )return -EINVAL ;
@@ -1157,10 +1165,6 @@ static int nfs_validate_mount_data(void *options, goto out_v3_not_compiled;#endif /* !CONFIG_NFS_V3 */ -if (!nfs_verify_server_address ((struct sockaddr *) - &args->nfs_server.address)) - goto out_no_address; -return 0 ; out_no_data:
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs