Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6e88e0618cb1e354a44cc49a996df4dd89511039 Commit: 6e88e0618cb1e354a44cc49a996df4dd89511039 Parent: 113632d00acb569420b14eb7575833ac7e2eb311 Author: Chuck Lever <[EMAIL PROTECTED]> AuthorDate: Mon Sep 24 15:39:50 2007 -0400 Committer: Trond Myklebust <[EMAIL PROTECTED]> CommitDate: Tue Oct 9 17:18:14 2007 -0400
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]> Signed-off-by: Trond Myklebust <[EMAIL PROTECTED]> --- fs/nfs/super.c | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/fs/nfs/super.c b/fs/nfs/super.c index 11ab7ff..13a3ab3 100644 --- a/fs/nfs/super.c +++ b/fs/nfs/super.c @@ -1100,6 +1100,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. @@ -1131,6 +1135,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; @@ -1159,10 +1167,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: - To unsubscribe from this list: send the line "unsubscribe git-commits-head" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html