From: Darrick J. Wong Date: Mon, 16 Dec 2024 02:18:44 +0000 (-0800) Subject: xfs: return from xfs_symlink_verify early on V4 filesystems X-Git-Tag: v6.13.0~80 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=3e8a2c473d885cbcb8bcdfd5497a4e98bf938323;p=thirdparty%2Fxfsprogs-dev.git xfs: return from xfs_symlink_verify early on V4 filesystems Source kernel commit: 7f8b718c58783f3ff0810b39e2f62f50ba2549f6 V4 symlink blocks didn't have headers, so return early if this is a V4 filesystem. Cc: # v5.1 Fixes: 39708c20ab5133 ("xfs: miscellaneous verifier magic value fixups") Signed-off-by: "Darrick J. Wong" Reviewed-by: Christoph Hellwig --- diff --git a/libxfs/xfs_symlink_remote.c b/libxfs/xfs_symlink_remote.c index 2ad586f3..1c355f75 100644 --- a/libxfs/xfs_symlink_remote.c +++ b/libxfs/xfs_symlink_remote.c @@ -89,8 +89,10 @@ xfs_symlink_verify( struct xfs_mount *mp = bp->b_mount; struct xfs_dsymlink_hdr *dsl = bp->b_addr; + /* no verification of non-crc buffers */ if (!xfs_has_crc(mp)) - return __this_address; + return NULL; + if (!xfs_verify_magic(bp, dsl->sl_magic)) return __this_address; if (!uuid_equal(&dsl->sl_uuid, &mp->m_sb.sb_meta_uuid))