Date: Wed, 24 Jul 2013 10:46:32 +0000 (UTC) From: Rick Macklem <rmacklem@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r253608 - stable/9/sys/fs/nfs Message-ID: <201307241046.r6OAkWej020865@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: rmacklem Date: Wed Jul 24 10:46:32 2013 New Revision: 253608 URL: http://svnweb.freebsd.org/changeset/base/253608 Log: MFC: r253506 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: a.heider@gmail.com (Andre Heider) Approved by: re (Xin Li) Modified: stable/9/sys/fs/nfs/nfs_commonsubs.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) Modified: stable/9/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- stable/9/sys/fs/nfs/nfs_commonsubs.c Wed Jul 24 10:12:50 2013 (r253607) +++ stable/9/sys/fs/nfs/nfs_commonsubs.c Wed Jul 24 10:46:32 2013 (r253608) @@ -742,21 +742,21 @@ nfsrv_getattrbits(struct nfsrv_descript 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:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201307241046.r6OAkWej020865>