Examine all remote xattr values of a file, not just the XFS_ATTR_ROOT
values. This enables us to detect and zap corrupt user xattrs, as
tested by xfs/404.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Allison Henderson <allison.henderson@oracle.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
return -1;
}
- if (!(entry->flags & XFS_ATTR_ROOT))
- goto out;
-
value = malloc(be32_to_cpu(remotep->valuelen));
if (value == NULL) {
do_warn(
i, ino);
goto bad_free_out;
}
- if (valuecheck(mp, (char *)&remotep->name[0], value, remotep->namelen,
+ if ((entry->flags & XFS_ATTR_ROOT) &&
+ valuecheck(mp, (char *)&remotep->name[0], value, remotep->namelen,
be32_to_cpu(remotep->valuelen))) {
do_warn(
_("remote attribute value check failed for entry %d, inode %" PRIu64 "\n"),