HIGH Introduced in 6.15
xfs MetafileResv Underflow
CVE-2026-98446
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:H
01Description
In the Linux kernel, the following vulnerability has been resolved: xfs: don't let hidden_space go negative in xfs_metafile_resv_init LOLLM points out that if the amount of fdblocks that we can reserve for a metadata btree file goes below the space already used by that file, then the hidden_space subtraction can underflow, causing xfs_dec_fdblocks to subtract a huge amount of space. We never want the target to be less than the used sapce, so fix the logic that adjusts dblocks_avail downwards. Also fix an error in the adjacent comment.
02KernelScan AI Analysis
Risk summary
A local attacker with access to an XFS filesystem can trigger an integer underflow in metadata btree space reservation calculations, causing the kernel to incorrectly account for free space. This leads to filesystem metadata corruption and potential kernel panic, resulting in data loss and denial of service.
Vulnerability analysis
When calculating reserved space for metadata btrees on an XFS filesystem, the code can miscalculate if free space drops below the space already used by those trees. The reservation target gets set to the available free space without checking that it remains above the used space, causing a subtraction to wrap around to a very large number. This huge value is then subtracted from the filesystem's free block counter, corrupting space accounting. The fix clamps the reservation target to never be less than the used space, preventing the wraparound. Any local user with write access to a mounted XFS filesystem — including regular users, container workloads, or compromised services — can trigger this by filling the filesystem until free space falls below the metadata tree's used space.
Lifecycle
03Fix Versions
| Branch | Introduced | Fixed in | Patch commit |
|---|---|---|---|
| 6.18 | 6.15 | 6.18.55 | 930a9c1c321e |
| 7.2 | 6.15 | 7.2.9 | f0d8352a39f4 |
| mainline | 6.15 | 7.3 | 476582d754cd |