From: J. Bruce Fields Date: Mon, 22 Dec 2014 21:14:51 +0000 (-0500) Subject: rpc: fix xdr_truncate_encode to handle buffer ending on page boundary X-Git-Tag: fixes-v4.0-rc1~325^2 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=49a068f82a1d30eb585d7804b05948376be6cf9a;p=pandora-kernel.git 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: Holger Hoffstätte Tested-by: Holger Hoffstätte Fixes: 3e19ce762b53 "rpc: xdr_truncate_encode" Cc: stable@vger.kernel.org Signed-off-by: J. Bruce Fields --- Reading git-diff-tree failed