aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/super.c
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2007-09-20 20:23:51 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2007-10-09 17:17:31 -0400
commit20c71f5e0f954b00d75009542db2c1f844d94a1e (patch)
tree0ff5e7212188238735757dd72ec746ab673ef1fd /fs/nfs/super.c
parent91ea40b9c6303ddab5c84f078f96b29084b45817 (diff)
NFSv4: Fix a bug in nfs4_validate_mount_data()
The previous patch introduced a bug when copying the server address. Also clarify a copy into the auth_flavours array: currently the two size calculations are equivalent, but we may decide to change the size of auth_flavors[] at some point. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/super.c')
-rw-r--r--fs/nfs/super.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/nfs/super.c b/fs/nfs/super.c
index 63742bbcb1ce..3804aadc18c4 100644
--- a/fs/nfs/super.c
+++ b/fs/nfs/super.c
@@ -1541,7 +1541,7 @@ static int nfs4_validate_mount_data(void *options,
1541 goto out_no_address; 1541 goto out_no_address;
1542 if (copy_from_user(&args->nfs_server.address, 1542 if (copy_from_user(&args->nfs_server.address,
1543 data->host_addr, 1543 data->host_addr,
1544 sizeof(&args->nfs_server.address))) 1544 sizeof(args->nfs_server.address)))
1545 return -EFAULT; 1545 return -EFAULT;
1546 if (args->nfs_server.address.sin_port == 0) 1546 if (args->nfs_server.address.sin_port == 0)
1547 args->nfs_server.address.sin_port = htons(NFS_PORT); 1547 args->nfs_server.address.sin_port = htons(NFS_PORT);
@@ -1554,9 +1554,9 @@ static int nfs4_validate_mount_data(void *options,
1554 args->auth_flavors[0] = RPC_AUTH_UNIX; 1554 args->auth_flavors[0] = RPC_AUTH_UNIX;
1555 break; 1555 break;
1556 case 1: 1556 case 1:
1557 if (copy_from_user(args->auth_flavors, 1557 if (copy_from_user(&args->auth_flavors[0],
1558 data->auth_flavours, 1558 data->auth_flavours,
1559 sizeof(args->auth_flavors))) 1559 sizeof(args->auth_flavors[0])))
1560 return -EFAULT; 1560 return -EFAULT;
1561 break; 1561 break;
1562 default: 1562 default: