Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 24750082 authored by J. Bruce Fields's avatar J. Bruce Fields
Browse files

nfsd4: fix decoding of compounds across page boundaries



A freebsd NFSv4.0 client was getting rare IO errors expanding a tarball.
A network trace showed the server returning BAD_XDR on the final getattr
of a getattr+write+getattr compound.  The final getattr started on a
page boundary.

I believe the Linux client ignores errors on the post-write getattr, and
that that's why we haven't seen this before.

Cc: stable@vger.kernel.org
Reported-by: default avatarRick Macklem <rmacklem@uoguelph.ca>
Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
parent 99c41515
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -167,8 +167,8 @@ static __be32 *read_buf(struct nfsd4_compoundargs *argp, u32 nbytes)
	 */
	memcpy(p, argp->p, avail);
	/* step to next page */
	argp->p = page_address(argp->pagelist[0]);
	argp->pagelist++;
	argp->p = page_address(argp->pagelist[0]);
	if (argp->pagelen < PAGE_SIZE) {
		argp->end = argp->p + (argp->pagelen>>2);
		argp->pagelen = 0;