diff options
author | jeff <jeff@FreeBSD.org> | 2002-10-31 22:35:03 +0000 |
---|---|---|
committer | jeff <jeff@FreeBSD.org> | 2002-10-31 22:35:03 +0000 |
commit | b2bc94cc0d79ef0ae249eac8fcd4547ca9e63c1d (patch) | |
tree | 1e5a0173186d567be63306862a2fffb8558bf8f0 /sys/nfsserver/nfs_serv.c | |
parent | 594d92f0f90fc612e2bec96bd4e994b22ff77551 (diff) | |
download | FreeBSD-src-b2bc94cc0d79ef0ae249eac8fcd4547ca9e63c1d.zip FreeBSD-src-b2bc94cc0d79ef0ae249eac8fcd4547ca9e63c1d.tar.gz |
- Introduce a new macro, since that's what nfs loves, called
nfsm_srvpathsiz. This macro plucks a length out of an rpc request and
verifies that its size does not exceed NFS_MAXPATHLEN. If it does
it generates an ENAMETOOLONG response.
- Use this macro, and the existing nfsm_srvnamsiz macro in two places
where we deal with paths passed in by the client.
This fixes a linux interoperability bug. Linux was sending oversized path
components which would cause us to ignore the request all together. This
causes linux to hang indefinitly while it waits for a response. This
could still happen in other cases where we error out with EBADRPC.
Sponsored by: Isilon Systems, Inc.
Reviewed by: alfred, fabbri@isilon.com, neal@isilon.com
Diffstat (limited to 'sys/nfsserver/nfs_serv.c')
-rw-r--r-- | sys/nfsserver/nfs_serv.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/nfsserver/nfs_serv.c b/sys/nfsserver/nfs_serv.c index 00c9da9..3e28fad 100644 --- a/sys/nfsserver/nfs_serv.c +++ b/sys/nfsserver/nfs_serv.c @@ -2221,7 +2221,7 @@ nfsrv_rename(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, } fvp = fromnd.ni_vp; nfsm_srvmtofh(tfhp); - nfsm_strsiz(len2, NFS_MAXNAMLEN); + nfsm_srvnamesiz(len2); cred->cr_uid = saved_uid; tond.ni_cnd.cn_cred = cred; tond.ni_cnd.cn_nameiop = RENAME; @@ -2550,7 +2550,7 @@ nfsrv_symlink(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, VATTR_NULL(vap); if (v3) nfsm_srvsattr(vap); - nfsm_strsiz(len2, NFS_MAXPATHLEN); + nfsm_srvpathsiz(len2); MALLOC(pathcp, caddr_t, len2 + 1, M_TEMP, M_WAITOK); iv.iov_base = pathcp; iv.iov_len = len2; |