summaryrefslogtreecommitdiffstats
path: root/sys/fs
diff options
context:
space:
mode:
authorrmacklem <rmacklem@FreeBSD.org>2013-07-20 22:35:32 +0000
committerrmacklem <rmacklem@FreeBSD.org>2013-07-20 22:35:32 +0000
commit51bcea9c2c72d61c7bbc8c48156326accb7d4a95 (patch)
treec6fb9485493ac997a0b37702f1c07367ca923932 /sys/fs
parent43ff25fce868f013654ddbc0496bc7928c10bbdf (diff)
downloadFreeBSD-src-51bcea9c2c72d61c7bbc8c48156326accb7d4a95.zip
FreeBSD-src-51bcea9c2c72d61c7bbc8c48156326accb7d4a95.tar.gz
The NFSv4 server incorrectly assumed that the high order words of
the attribute bitmap argument would be non-zero. This caused an interoperability problem for a recent patch to the Linux NFSv4 client. The Linux folks have changed their patch to avoid this, but this patch fixes the problem on the server. Reported and tested by: Andre Heider (a.heider@gmail.com) MFC after: 3 days
Diffstat (limited to 'sys/fs')
-rw-r--r--sys/fs/nfs/nfs_commonsubs.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/sys/fs/nfs/nfs_commonsubs.c b/sys/fs/nfs/nfs_commonsubs.c
index 808d2b2..b60b0eb 100644
--- a/sys/fs/nfs/nfs_commonsubs.c
+++ b/sys/fs/nfs/nfs_commonsubs.c
@@ -761,21 +761,21 @@ nfsrv_getattrbits(struct nfsrv_descript *nd, nfsattrbit_t *attrbitp, int *cntp,
error = NFSERR_BADXDR;
goto nfsmout;
}
- if (cnt > NFSATTRBIT_MAXWORDS) {
+ if (cnt > NFSATTRBIT_MAXWORDS)
outcnt = NFSATTRBIT_MAXWORDS;
- if (retnotsupp)
- *retnotsupp = NFSERR_ATTRNOTSUPP;
- } else {
+ else
outcnt = cnt;
- }
NFSZERO_ATTRBIT(attrbitp);
if (outcnt > 0) {
NFSM_DISSECT(tl, u_int32_t *, outcnt * NFSX_UNSIGNED);
for (i = 0; i < outcnt; i++)
attrbitp->bits[i] = fxdr_unsigned(u_int32_t, *tl++);
}
- if (cnt > outcnt)
- error = nfsm_advance(nd, (cnt - outcnt) * NFSX_UNSIGNED, -1);
+ for (i = 0; i < (cnt - outcnt); i++) {
+ NFSM_DISSECT(tl, u_int32_t *, NFSX_UNSIGNED);
+ if (retnotsupp != NULL && *tl != 0)
+ *retnotsupp = NFSERR_ATTRNOTSUPP;
+ }
if (cntp)
*cntp = NFSX_UNSIGNED + (cnt * NFSX_UNSIGNED);
nfsmout:
OpenPOWER on IntegriCloud