diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2008-06-19 19:21:11 (GMT) |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2008-06-23 21:09:06 (GMT) |
commit | b7e2445737ff69cef892b6fd9cd71cae2c9e9515 (patch) | |
tree | d248fa5765d8e4b6ab00f10a77f9cbe793644672 /fs/nfs/super.c | |
parent | 33852a1f2bb014e4047a844556c0d76a2f790c37 (diff) | |
download | linux-fsl-qoriq-b7e2445737ff69cef892b6fd9cd71cae2c9e9515.tar.xz |
NFS: Fix filehandle size comparisons in the mount code
Fix a sign issue in xdr_decode_fhstatus3()
Fix incorrect comparison in nfs_validate_mount_data()
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/super.c')
-rw-r--r-- | fs/nfs/super.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/nfs/super.c b/fs/nfs/super.c index dac663d..614efee 100644 --- a/fs/nfs/super.c +++ b/fs/nfs/super.c @@ -1249,13 +1249,13 @@ static int nfs_validate_mount_data(void *options, case 5: memset(data->context, 0, sizeof(data->context)); case 6: - if (data->flags & NFS_MOUNT_VER3) + if (data->flags & NFS_MOUNT_VER3) { + if (data->root.size > NFS3_FHSIZE || data->root.size == 0) + goto out_invalid_fh; mntfh->size = data->root.size; - else + } else mntfh->size = NFS2_FHSIZE; - if (mntfh->size > sizeof(mntfh->data)) - goto out_invalid_fh; memcpy(mntfh->data, data->root.data, mntfh->size); if (mntfh->size < sizeof(mntfh->data)) |