diff options
author | Darrick J. Wong <darrick.wong@oracle.com> | 2019-02-01 20:08:54 +0300 |
---|---|---|
committer | Darrick J. Wong <darrick.wong@oracle.com> | 2019-02-12 03:06:40 +0300 |
commit | 654805367d982cffdb9979453673aab9c3c96d07 (patch) | |
tree | c224d814747294d0f688c08dc7513b63a36916e4 /fs/xfs/scrub | |
parent | e5d7d51b340aac0f4cc56677eb8d29d4e164c58c (diff) | |
download | linux-654805367d982cffdb9979453673aab9c3c96d07.tar.xz |
xfs: check attribute name validity
Check extended attribute entry names for invalid characters.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Diffstat (limited to 'fs/xfs/scrub')
-rw-r--r-- | fs/xfs/scrub/attr.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/xfs/scrub/attr.c b/fs/xfs/scrub/attr.c index 9960bc5b5d76..dce74ec57038 100644 --- a/fs/xfs/scrub/attr.c +++ b/fs/xfs/scrub/attr.c @@ -93,6 +93,12 @@ xchk_xattr_listent( return; } + /* Does this name make sense? */ + if (!xfs_attr_namecheck(name, namelen)) { + xchk_fblock_set_corrupt(sx->sc, XFS_ATTR_FORK, args.blkno); + return; + } + args.flags = ATTR_KERNOTIME; if (flags & XFS_ATTR_ROOT) args.flags |= ATTR_ROOT; |