HIGH Introduced in 2.6.30
nilfs2 BtreeNode OOB
CVE-2026-89723
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
KernelScan AI7.8HIGH
01Description
In the Linux kernel, the following vulnerability has been resolved: nilfs2: fix slab-out-of-bounds in nilfs_direct_propagate after truncation Shuangpeng Bai reported that KASAN detected a slab-out-of-bounds error in nilfs_direct_propagate() during testing. Analysis revealed that after truncating a file, a node block immediately below the B-tree root was not deleted. Instead, it remained in the B-tree node cache in a dirty state. The log writer subsequently detected this block and incorrectly invoked nilfs_direct_propagate() on it, which is designed to handle only data blocks in direct mapping. B-tree nodes in the cache are managed by virtual block numbers, and their logical keys typically exceed the range expected by direct mapping. Consequently, processing such a node as a direct mapping entry triggers a slab-out-of-bounds access. The root cause is that when a B-tree mapping collapses into a direct mapping during truncation, an intermediate node block pointed to by the root node is left behind as garbage instead of being explicitly deleted. This resolves the issue by adding a nilfs_btree_discard() operation to delete the remaining intermediate node block during the conversion. A 'deform' flag is added to the bop_delete interface to explicitly signal that the deletion is part of a mapping transformation. This allows the B-tree mapping implementation to perform the necessary cleanup and discarding of the residual node structure that would be otherwise be left orphaned after the transition.
02KernelScan AI Analysis
Risk summary
A local user with write access to files on a mounted nilfs2 filesystem can trigger an out-of-bounds slab access by truncating a file whose block mapping transitions from B-tree to direct mapping. The resulting kernel memory corruption can lead to information disclosure, privilege escalation, or system crashes. Any system mounting nilfs2 and allowing untrusted users to create and truncate files is at risk.
Vulnerability analysis
When a file on a nilfs2 filesystem grows large enough to use B-tree block mapping and is then truncated so the mapping collapses back to direct mapping, an intermediate B-tree node block is left orphaned in the node cache in a dirty state instead of being deleted. The filesystem's log writer later encounters this orphaned block and incorrectly processes it through the direct mapping path, which expects keys within a small fixed range. Because the orphaned B-tree node's keys far exceed that range, the propagation code accesses slab memory out of bounds. The fix changes the conversion logic so that the residual intermediate node is properly removed during the collapse, preventing any orphaned node from being misinterpreted later. The bug is reachable by any local user who can create, grow, and truncate files on a mounted nilfs2 filesystem; mounting nilfs2 itself requires administrator privileges, but the triggering truncation operation does not.
Lifecycle
03Fix Versions
| Branch | Introduced | Fixed in | Patch commit |
|---|---|---|---|
| 5.10 | 2.6.30 | 5.10.270 | 39005fd1ce65 |
| 5.15 | 2.6.30 | 5.15.221 | bf49e6f6ddc1 |
| 6.1 | 2.6.30 | 6.1.188 | 4a1bb1f9f24a |
| 6.12 | 2.6.30 | 6.12.109 | 5d3783c451a5 |
| 6.18 | 2.6.30 | 6.18.50 | 448636c745a3 |
| 6.6 | 2.6.30 | 6.6.157 | b313edfbc0c2 |
| 7.2 | 2.6.30 | 7.2.4 | 28362e8ce513 |
| mainline | 2.6.30 | 7.3 | 45662dedb8f2 |
| cip/4.19 | 2.6.30 | 4.19.325-cip137 | 8267cf2f9af9 |
| cip/4.19-rt | 2.6.30 | 4.19.325-cip137-rt51 | 8267cf2f9af9 |
| cip/5.10 | 2.6.30 | 5.10.271-cip78 | 39005fd1ce65 |
| cip/5.10-rt | 2.6.30 | 5.10.272-cip79-rt35 | 39005fd1ce65 |
| cip/6.1 | 2.6.30 | 6.1.189-cip61 | 4a1bb1f9f24a |
| cip/6.1-rt | 2.6.30 | 6.1.189-cip61-rt32 | 4a1bb1f9f24a |
| cip/6.12 | 2.6.30 | 6.12.111-cip32 | 5d3783c451a5 |
04CIP Kernels
State of the newest release of each Civil Infrastructure Platform SLTS tree, from CIP's own fix records.
| CIP tree | State |
|---|---|
| cip/6.12 | Fixed in 6.12.111-cip32 |
| cip/6.1 | Fixed in 6.1.189-cip61 |
| cip/6.1-rt | Fixed in 6.1.189-cip61-rt32 |
| cip/5.10 | Fixed in 5.10.271-cip78 |
| cip/5.10-rt | Fixed in 5.10.272-cip79-rt35 |
| cip/4.19 | Fixed in 4.19.325-cip137 |
| cip/4.19-rt | Fixed in 4.19.325-cip137-rt51 |
| cip/4.4 | Affected — no CIP fix yet (latest 4.4.302-cip116) |
| cip/4.4-rt | Affected — no CIP fix yet (latest 4.4.302-cip115-rt63) |