KernelScan.io

HIGH Introduced in 2.6.30

nilfs2 BtreeNode OOB

CVE-2026-89723

CVSS 7.8 / 10.0 NVD

CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

KernelScan AI7.8HIGH

01

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.

02

Engine v0.6.0

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.

Affectedfs/nilfs2/btree.c (nilfs2 filesystem)

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.

03

BranchIntroducedFixed inPatch commit
5.102.6.305.10.27039005fd1ce65
5.152.6.305.15.221bf49e6f6ddc1
6.12.6.306.1.1884a1bb1f9f24a
6.122.6.306.12.1095d3783c451a5
6.182.6.306.18.50448636c745a3
6.62.6.306.6.157b313edfbc0c2
7.22.6.307.2.428362e8ce513
mainline2.6.307.345662dedb8f2
cip/4.192.6.304.19.325-cip1378267cf2f9af9
cip/4.19-rt2.6.304.19.325-cip137-rt518267cf2f9af9
cip/5.102.6.305.10.271-cip7839005fd1ce65
cip/5.10-rt2.6.305.10.272-cip79-rt3539005fd1ce65
cip/6.12.6.306.1.189-cip614a1bb1f9f24a
cip/6.1-rt2.6.306.1.189-cip61-rt324a1bb1f9f24a
cip/6.122.6.306.12.111-cip325d3783c451a5

04

State of the newest release of each Civil Infrastructure Platform SLTS tree, from CIP's own fix records.

CIP treeState
cip/6.12Fixed in 6.12.111-cip32
cip/6.1Fixed in 6.1.189-cip61
cip/6.1-rtFixed in 6.1.189-cip61-rt32
cip/5.10Fixed in 5.10.271-cip78
cip/5.10-rtFixed in 5.10.272-cip79-rt35
cip/4.19Fixed in 4.19.325-cip137
cip/4.19-rtFixed in 4.19.325-cip137-rt51
cip/4.4Affected — no CIP fix yet (latest 4.4.302-cip116)
cip/4.4-rtAffected — no CIP fix yet (latest 4.4.302-cip115-rt63)