From: Darrick J. Wong Date: Wed, 11 Mar 2020 17:38:09 +0000 (-0700) Subject: xfs: mark extended attr corrupt when lookup-by-hash fails X-Git-Tag: v5.7-rc1~125^2~46 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=806d3909a57eae6282725d1f9059350932e90c35;p=thirdparty%2Fkernel%2Flinux.git xfs: mark extended attr corrupt when lookup-by-hash fails In xchk_xattr_listent, we attempt to validate the extended attribute hash structures by performing a attr lookup by (hashed) name. If the lookup returns ENODATA, that means that the hash information is corrupt. The _process_error functions don't catch this, so we have to add that explicitly. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner --- diff --git a/fs/xfs/scrub/attr.c b/fs/xfs/scrub/attr.c index 0d3b5c03eca0c..9faddb334a2c3 100644 --- a/fs/xfs/scrub/attr.c +++ b/fs/xfs/scrub/attr.c @@ -160,6 +160,9 @@ xchk_xattr_listent( args.valuelen = valuelen; error = xfs_attr_get_ilocked(&args); + /* ENODATA means the hash lookup failed and the attr is bad */ + if (error == -ENODATA) + error = -EFSCORRUPTED; if (!xchk_fblock_process_error(sx->sc, XFS_ATTR_FORK, args.blkno, &error)) goto fail_xref;