CVE-2026-99689: xfs: fix temporary cursor leak in btree shift corruption paths
In the Linux kernel, the following vulnerability has been resolved:
xfs: fix temporary cursor leak in btree shift corruption paths
In xfsbtreelshift and xfsbtreershift, when XFSISCORRUPT detects an invalid firstrec/lastrec result after xfsbtreedupcursor has successfully allocated a temporary cursor, the error path jumps to error0 which returns without freeing tcur. This leaks the cursor memory, the xfsgroup reference, and the per-level buffer references held by the duplicated cursor. Jump to error1 instead, which calls xfsbtreedelcursor(tcur, XFSBTREEERROR) to properly release all resources.
Affected Software
Frequently Asked Questions
What conditions trigger the resource leak?
The leak occurs when xfs_btree_lshift or xfs_btree_rshift duplicates a btree cursor successfully and then detects an invalid firstrec or lastrec result through XFS_IS_CORRUPT. The affected corruption-handling path returns without releasing the temporary cursor and its associated references.
What resources are leaked on the affected error path?
The temporary cursor memory is leaked, along with its xfs_group reference and the per-level buffer references held by the duplicated cursor.
What does the fix change?
The fix redirects the relevant error path to cleanup handling that calls xfs_btree_del_cursor(tcur, XFS_BTREE_ERROR). This releases the temporary cursor and all associated resources.