Skip to content

Commit c12ad41

Browse files
author
Darrick J. Wong
committed
xfs: xattr scrub should ensure one namespace bit per name
Check that each extended attribute exists in only one namespace. Signed-off-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Dave Chinner <dchinner@redhat.com>
1 parent 1c1646a commit c12ad41

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

fs/xfs/scrub/attr.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,16 @@ xchk_xattr_listent(
128128
return;
129129
}
130130

131+
/* Only one namespace bit allowed. */
132+
if (hweight32(flags & XFS_ATTR_NSP_ONDISK_MASK) > 1) {
133+
xchk_fblock_set_corrupt(sx->sc, XFS_ATTR_FORK, args.blkno);
134+
goto fail_xref;
135+
}
136+
131137
/* Does this name make sense? */
132138
if (!xfs_attr_namecheck(name, namelen)) {
133139
xchk_fblock_set_corrupt(sx->sc, XFS_ATTR_FORK, args.blkno);
134-
return;
140+
goto fail_xref;
135141
}
136142

137143
/*

0 commit comments

Comments
 (0)