]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
xfs: drop ASSERT(0) on unrecognized log item type
authorWeiming Shi <bestswngs@gmail.com>
Thu, 2 Jul 2026 16:19:58 +0000 (09:19 -0700)
committerCarlos Maiolino <cem@kernel.org>
Tue, 7 Jul 2026 07:57:19 +0000 (09:57 +0200)
The item type passed to ITEM_TYPE() comes from the on-disk log, so a
fuzzed or crafted image can reach the "unrecognized type" path in
xlog_recover_reorder_trans() and trip its ASSERT(0) on a
CONFIG_XFS_DEBUG kernel.  The -EFSCORRUPTED return handles it fine; drop
the assert.

Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Weiming Shi <bestswngs@gmail.com>
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
fs/xfs/xfs_log_recover.c

index 5f984bf5698a89ede88d62c0cd1a240c07572332..a1b373c68f0e6ae389d5bcc4aeef427502413ef8 100644 (file)
@@ -1912,7 +1912,6 @@ xlog_recover_reorder_trans(
                        xfs_warn(log->l_mp,
                                "%s: unrecognized type of log operation (%d)",
                                __func__, ITEM_TYPE(item));
-                       ASSERT(0);
                        /*
                         * return the remaining items back to the transaction
                         * item list so they can be freed in caller.