• Jorge Mora's avatar
    NFSD: fix nfsd4_listxattr_validate_cookie · 52a357db
    Jorge Mora authored
    If LISTXATTRS is sent with a correct cookie but a small maxcount,
    this could lead function nfsd4_listxattr_validate_cookie to
    return NFS4ERR_BAD_COOKIE. If maxcount = 20, then second check
    on function gives RHS = 3 thus any cookie larger than 3 returns
    NFS4ERR_BAD_COOKIE.
    
    There is no need to validate the cookie on the return XDR buffer
    since attribute referenced by cookie will be the first in the
    return buffer.
    
    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>
    52a357db
nfs4xdr.c 152 KB