CVE-2026-31454: xfs: save ailp before dropping the AIL lock in push callbacks
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
xfs: save ailp before dropping the AIL lock in push callbacks
In xfs_inode_item_push() and xfs_qm_dquot_logitem_push(), the AIL lock is dropped to perform buffer IO. Once the cluster buffer no longer protects the log item from reclaim, the log item may be freed by background reclaim or the dquot shrinker. The subsequent spin_lock() call dereferences lip->li_ailp, which is a use-after-free.
Fix this by saving the ailp pointer in a local variable while the AIL lock is held and the log item is guaranteed to be valid.
The Linux kernel CVE team has assigned CVE-2026-31454 to this issue.
Affected and fixed versions
===========================
Issue introduced in 5.9 with commit 90c60e16401248a4900f3f9387f563d0178dcf34 and fixed in 5.10.253 with commit edd1637d4e3911ab6c760f553f2040fe72f61a13 Issue introduced in 5.9 with commit 90c60e16401248a4900f3f9387f563d0178dcf34 and fixed in 5.15.203 with commit 19437e4f7bb909afde832b39372aa2f3ce3cfd88 Issue introduced in 5.9 with commit 90c60e16401248a4900f3f9387f563d0178dcf34 and fixed in 6.1.168 with commit 6dbe17f19c290a72ce57d5abc70e1fad0c3e14e5 Issue introduced in 5.9 with commit 90c60e16401248a4900f3f9387f563d0178dcf34 and fixed in 6.6.131 with commit 75669e987137f49c99ca44406bf0200d1892dd16 Issue introduced in 5.9 with commit 90c60e16401248a4900f3f9387f563d0178dcf34 and fixed in 6.12.80 with commit d8fc60bbaf5aea1604bf9f4ed565da6a1ac7a87d Issue introduced in 5.9 with commit 90c60e16401248a4900f3f9387f563d0178dcf34 and fixed in 6.18.21 with commit 50f5f056807b7bed74f4f307f2ca0ed92f3e556d Issue introduced in 5.9 with commit 90c60e16401248a4900f3f9387f563d0178dcf34 and fixed in 6.19.11 with commit 4c7d50147316cf049462f327c4a3e9dc2b7f1dd0 Issue introduced in 5.9 with commit 90c60e16401248a4900f3f9387f563d0178dcf34 and fixed in 7.0 with commit 394d70b86fae9fe865e7e6d9540b7696f73aa9b6
Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.
Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at
https://cve.org/CVERecord/?id=CVE-2026-31454
will be updated if fixes are backported, please check that for the most up to date information about this issue.
Affected files
==============
The file(s) affected by this issue are:
fs/xfs/xfs_dquot_item.c
fs/xfs/xfs_inode_item.c
Mitigation
==========
The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:
https://git.kernel.org/stable/c/edd1637d4e3911ab6c760f553f2040fe72f61a13 https://git.kernel.org/stable/c/19437e4f7bb909afde832b39372aa2f3ce3cfd88 https://git.kernel.org/stable/c/6dbe17f19c290a72ce57d5abc70e1fad0c3e14e5 https://git.kernel.org/stable/c/75669e987137f49c99ca44406bf0200d1892dd16 https://git.kernel.org/stable/c/d8fc60bbaf5aea1604bf9f4ed565da6a1ac7a87d https://git.kernel.org/stable/c/50f5f056807b7bed74f4f307f2ca0ed92f3e556d https://git.kernel.org/stable/c/4c7d50147316cf049462f327c4a3e9dc2b7f1dd0 https://git.kernel.org/stable/c/394d70b86fae9fe865e7e6d9540b7696f73aa9b6