Re: [PATCH] Fix NFS option parsing bit-rot.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 6/6/16, 18:58, "Rob Landley" <rob@xxxxxxxxxxx> wrote:

>From: Rob Landley <rob@xxxxxxxxxxx>
>
>The kernel has string parsing code for NFS mount options, but it seems
>to have bit-rotted over the years, so toybox mount needs the following
>patch to be able to mount nfs. Without it, the kernel returns "invalid
>argument" before sending any network traffic.
>
>For more information, see
>http://lists.landley.net/pipermail/toybox-landley.net/2016-March/004790.html
>
>Signed-off-by: Rob Landley <rob@xxxxxxxxxxx>
>---
>
> fs/nfs/super.c |   18 +++++++++++++-----
> 1 file changed, 13 insertions(+), 5 deletions(-)
>
>diff --git a/fs/nfs/super.c b/fs/nfs/super.c
>index 2137e02..863585d 100644
>--- a/fs/nfs/super.c
>+++ b/fs/nfs/super.c
>@@ -2130,11 +2130,23 @@ static int nfs_validate_text_mount_data(void *options,
> 	int port = 0;
> 	int max_namelen = PAGE_SIZE;
> 	int max_pathlen = NFS_MAXPATHLEN;
>+	int rc;
> 	struct sockaddr *sap = (struct sockaddr *)&args->nfs_server.address;
> 
> 	if (nfs_parse_mount_options((char *)options, args) == 0)
> 		return -EINVAL;
> 
>+	rc = nfs_parse_devname(dev_name,
>+				   &args->nfs_server.hostname,
>+				   max_namelen,
>+				   &args->nfs_server.export_path,
>+				   max_pathlen);
>+
>+	args->nfs_server.addrlen = rpc_pton(args->net,
>+			args->nfs_server.hostname,
>+			strlen(args->nfs_server.hostname),
>+			sap, sizeof(args->nfs_server.address));
>+

That will scribble over the parsed address.

Trond


��.n��������+%������w��{.n�����{��w���jg��������ݢj����G�������j:+v���w�m������w�������h�����٥




[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux