Skip to content
Commit 49a068f8 authored by J. Bruce Fields's avatar J. Bruce Fields
Browse files

rpc: fix xdr_truncate_encode to handle buffer ending on page boundary



A struct xdr_stream at a page boundary might point to the end of one
page or the beginning of the next, but xdr_truncate_encode isn't
prepared to handle the former.

This can cause corruption of NFSv4 READDIR replies in the case that a
readdir entry that would have exceeded the client's dircount/maxcount
limit would have ended exactly on a 4k page boundary.  You're more
likely to hit this case on large directories.

Other xdr_truncate_encode callers are probably also affected.

Reported-by: default avatarHolger Hoffstätte <holger.hoffstaette@googlemail.com>
Tested-by: default avatarHolger Hoffstätte <holger.hoffstaette@googlemail.com>
Fixes: 3e19ce76

 "rpc: xdr_truncate_encode"
Cc: stable@vger.kernel.org
Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
parent 94ae1db2
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment