From: Darrick J. Wong Date: Mon, 28 Sep 2020 21:35:37 +0000 (-0400) Subject: xfs_repair: junk corrupt xattr root blocks X-Git-Tag: xfsprogs-5.9-fixes2_2020-10-10~20 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=78cc984db331315fe11be4991e0f91dad761135b;p=thirdparty%2Fxfsprogs-dev.git xfs_repair: junk corrupt xattr root blocks If reading the root block of an extended attribute structure fails due to a corruption error, we should junk the block since we know it's bad. There's no point in moving on to the (rather insufficient) checks in the attr code. Found by fuzzing hdr.freemap[1].base = ones in xfs/400. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Signed-off-by: Eric Sandeen --- diff --git a/repair/attr_repair.c b/repair/attr_repair.c index 6cec0f707..d92909e1c 100644 --- a/repair/attr_repair.c +++ b/repair/attr_repair.c @@ -1107,6 +1107,15 @@ process_longform_attr( ino); return 1; } + + if (bp->b_error == -EFSCORRUPTED) { + do_warn( + _("corrupt block 0 of inode %" PRIu64 " attribute fork\n"), + ino); + libxfs_buf_relse(bp); + return 1; + } + if (bp->b_error == -EFSBADCRC) (*repair)++;