Skip to content
Commit 2f73f37d authored by Jorge Mora's avatar Jorge Mora Committed by Chuck Lever
Browse files

NFSD: fix LISTXATTRS returning a short list with eof=TRUE

If the XDR buffer is not large enough to fit all attributes
and the remaining bytes left in the XDR buffer (xdrleft) is
equal to the number of bytes for the current attribute, then
the loop will prematurely exit without setting eof to FALSE.
Also in this case, adding the eof flag to the buffer will
make the reply 4 bytes larger than lsxa_maxcount.

Need to check if there are enough bytes to fit not only the
next attribute name but also the eof as well.

Fixes: 23e50fe3

 ("nfsd: implement the xattr functions and en/decode logic")
Signed-off-by: default avatarJorge Mora <mora@netapp.com>
Reviewed-by: default avatarJeff Layton <jlayton@kernel.org>
Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
parent 61ab5e07
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