mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-29 10:01:25 +00:00
NFSv4: handle lack of clientaddr in option string
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>
This commit is contained in:
parent
f9d888fcd9
commit
0a87cf128f
1 changed files with 7 additions and 0 deletions
|
@ -1685,6 +1685,9 @@ static int nfs4_validate_mount_data(struct nfs4_mount_data **options,
|
||||||
|
|
||||||
dprintk("MNTPATH: %s\n", *mntpath);
|
dprintk("MNTPATH: %s\n", *mntpath);
|
||||||
|
|
||||||
|
if (args.client_address == NULL)
|
||||||
|
goto out_no_client_address;
|
||||||
|
|
||||||
*ip_addr = args.client_address;
|
*ip_addr = args.client_address;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
@ -1705,6 +1708,10 @@ out_inval_auth:
|
||||||
out_no_address:
|
out_no_address:
|
||||||
dfprintk(MOUNT, "NFS4: mount program didn't pass remote address\n");
|
dfprintk(MOUNT, "NFS4: mount program didn't pass remote address\n");
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
|
out_no_client_address:
|
||||||
|
dfprintk(MOUNT, "NFS4: mount program didn't pass callback address\n");
|
||||||
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue