1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-02 08:42:48 +00:00

Check the filehandle size when mounting.

Obtained from:  Constantine Sapuntzakis <csapuntz@openbsd.org>
This commit is contained in:
Peter Wemm 2001-07-30 20:01:59 +00:00
parent 6a0fc191fb
commit 7b141d5db3
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=80672
2 changed files with 4 additions and 0 deletions

View File

@ -804,6 +804,8 @@ nfs_mount(mp, path, data, ndp, p)
nfs_decode_args(nmp, &args);
return (0);
}
if (args.fhsize < 0 || args.fhsize > NFSX_V3FHMAX)
return (EINVAL);
error = copyin((caddr_t)args.fh, (caddr_t)nfh, args.fhsize);
if (error)
return (error);

View File

@ -804,6 +804,8 @@ nfs_mount(mp, path, data, ndp, p)
nfs_decode_args(nmp, &args);
return (0);
}
if (args.fhsize < 0 || args.fhsize > NFSX_V3FHMAX)
return (EINVAL);
error = copyin((caddr_t)args.fh, (caddr_t)nfh, args.fhsize);
if (error)
return (error);