Skip to content

Commit

Permalink
NFSv4: handle lack of clientaddr in option string
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jeff Layton authored and Trond Myklebust committed Jul 19, 2007
1 parent f9d888f commit 0a87cf1
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions fs/nfs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -1705,6 +1708,10 @@ static int nfs4_validate_mount_data(struct nfs4_mount_data **options,
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;
}

/*
Expand Down

0 comments on commit 0a87cf1

Please sign in to comment.