Commit c12ad414 authored by Darrick J. Wong's avatar Darrick J. Wong

xfs: xattr scrub should ensure one namespace bit per name

Check that each extended attribute exists in only one namespace.
Signed-off-by: default avatarDarrick J. Wong <djwong@kernel.org>
Reviewed-by: default avatarDave Chinner <dchinner@redhat.com>
parent 1c1646af
...@@ -128,10 +128,16 @@ xchk_xattr_listent( ...@@ -128,10 +128,16 @@ xchk_xattr_listent(
return; return;
} }
/* Only one namespace bit allowed. */
if (hweight32(flags & XFS_ATTR_NSP_ONDISK_MASK) > 1) {
xchk_fblock_set_corrupt(sx->sc, XFS_ATTR_FORK, args.blkno);
goto fail_xref;
}
/* Does this name make sense? */ /* Does this name make sense? */
if (!xfs_attr_namecheck(name, namelen)) { if (!xfs_attr_namecheck(name, namelen)) {
xchk_fblock_set_corrupt(sx->sc, XFS_ATTR_FORK, args.blkno); xchk_fblock_set_corrupt(sx->sc, XFS_ATTR_FORK, args.blkno);
return; goto fail_xref;
} }
/* /*
......
Markdown is supported
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