• Darrick J. Wong's avatar
    xfs: fix missing check for invalid attr flags · f660ec8e
    Darrick J. Wong authored
    The xattr scrubber doesn't check for undefined flags in shortform attr
    entries.  Therefore, define a mask XFS_ATTR_ONDISK_MASK that has all
    possible XFS_ATTR_* flags in it, and use that to check for unknown bits
    in xchk_xattr_actor.
    
    Refactor the check in the dabtree scanner function to use the new mask
    as well.  The redundant checks need to be in place because the dabtree
    check examines the hash mappings and therefore needs to decode the attr
    leaf entries to compute the namehash.  This happens before the walk of
    the xattr entries themselves.
    
    Fixes: ae0506eb ("xfs: check used space of shortform xattr structures")
    Signed-off-by: default avatarDarrick J. Wong <djwong@kernel.org>
    Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
    f660ec8e
attr.c 15.9 KB