NFSv4: handle lack of clientaddr in option string
authorJeff Layton <jlayton@redhat.com>
Wed, 18 Jul 2007 15:28:43 +0000 (11:28 -0400)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Thu, 19 Jul 2007 19:21:40 +0000 (15:21 -0400)
If a NFSv4 mount is attempted  with string based options, and the
option string doesn't contain a clientaddr= option, the kernel will
currently oops. Check for this situation and return a proper error.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
fs/nfs/super.c

index adffe1615c51e422b3cfa5ce1b76d644fab53aa2..b34b7a711d5b6e3e7f8280b71ee26940523f0eaf 100644 (file)
@@ -1685,6 +1685,9 @@ static int nfs4_validate_mount_data(struct nfs4_mount_data **options,
 
                dprintk("MNTPATH: %s\n", *mntpath);
 
+               if (args.client_address == NULL)
+                       goto out_no_client_address;
+
                *ip_addr = args.client_address;
 
                break;
@@ -1705,6 +1708,10 @@ out_inval_auth:
 out_no_address:
        dfprintk(MOUNT, "NFS4: mount program didn't pass remote address\n");
        return -EINVAL;
+
+out_no_client_address:
+       dfprintk(MOUNT, "NFS4: mount program didn't pass callback address\n");
+       return -EINVAL;
 }
 
 /*