HIGH Introduced in 2.6.30
nilfs2 BlockIndex Corruption
CVE-2026-80807
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
01Description
In the Linux kernel, the following vulnerability has been resolved: nilfs2: reject invalid block index in GC ioctl Syzbot reported list corruption caused by a double list_add_tail() call on bh->b_assoc_buffers within nilfs_lookup_dirty_data_buffers(). Analysis revealed that the root cause was the insertion of a page/folio with a page index of ULONG_MAX into the page cache via the GC ioctl. filemap_get_folios_tag(), called by nilfs_lookup_dirty_data_buffers(), repeatedly detects a dirty folio with a page index of ULONG_MAX due to index wrap-around, leading to duplicate processing of dirty buffers. As a preparatory step, the GC ioctl loads the page/folio of the block to be moved during GC and inserts it into the page cache based on information in the nilfs_vdesc structure passed as an argument. Normally, this does not cause issues because the user-space GC library configures the nilfs_vdesc structure properly. However, since there is no range check on the parameters determining the page index, a request with artificially crafted parameters -- such as those generated by Syzbot -- can result in a page/folio being inserted with a page index of ULONG_MAX, triggering the above problem. This resolves the issue by checking the ranges of 'vd_offset' and 'vd_vblocknr' in the nilfs_vdesc structure that determine the page index, thereby preventing the invalid page/folio insertions.
02KernelScan AI Analysis
Risk summary
A local user with write access to a file on a mounted nilfs2 filesystem can issue the garbage collector ioctl with crafted block descriptor parameters that bypass missing range checks. This causes a page with an index of ULONG_MAX to be inserted into the page cache, leading to duplicate dirty-buffer processing and linked-list corruption in kernel memory. The corruption can crash the kernel or potentially be leveraged for privilege escalation.
Vulnerability analysis
The nilfs2 garbage collector ioctl accepts a virtual block descriptor structure from userspace that specifies which blocks to move during GC. The code did not validate the block index fields in this structure, so a crafted request could produce a page cache index of ULONG_MAX. This causes index wrap-around during dirty-buffer lookup, making the same buffers appear multiple times and corrupting an internal linked list when they are added twice. The fix adds range checks on the block index fields, rejecting any descriptor whose values would exceed the filesystem's maximum block index or produce an invalid page index. Any local user who can open a file on a mounted nilfs2 filesystem with write permission can trigger this by issuing the GC ioctl with crafted parameters; no root or special capabilities are required.
Lifecycle
03Fix Versions
| Branch | Introduced | Fixed in | Patch commit |
|---|---|---|---|
| 5.10 | 2.6.30 | 5.10.269 | 898404cdf882 |
| 5.15 | 2.6.30 | 5.15.220 | ba8a8b563a28 |
| 6.1 | 2.6.30 | 6.1.187 | 3bd064ccc70b |
| 6.12 | 2.6.30 | 6.12.108 | 68aa9ab6f8f2 |
| 6.18 | 2.6.30 | 6.18.47 | e447f7edb99b |
| 6.6 | 2.6.30 | 6.6.156 | a5e776e29375 |
| 7.1 | 2.6.30 | 7.1.11 | ec6ddf271dfa |
| 7.2 | 2.6.30 | 7.2.1 | fbcfb75c20d7 |
| mainline | 2.6.30 | 7.3 | a1735eae5544 |
| cip/5.10 | 2.6.30 | 5.10.271-cip78 | 898404cdf882 |
| cip/6.1 | 2.6.30 | 6.1.187-cip60 | 3bd064ccc70b |
| cip/6.1-rt | 2.6.30 | 6.1.189-cip61-rt32 | 3bd064ccc70b |
| cip/6.12 | 2.6.30 | 6.12.108-cip31 | 68aa9ab6f8f2 |
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.108-cip31 |
| cip/6.1 | Fixed in 6.1.187-cip60 |
| cip/6.1-rt | Fixed in 6.1.189-cip61-rt32 |
| cip/5.10 | Fixed in 5.10.271-cip78 |
| cip/5.10-rt | Affected — no CIP fix yet (latest 5.10.268-cip77-rt34) |
| cip/4.19 | Affected — no CIP fix yet (latest 4.19.325-cip136) |
| cip/4.19-rt | Affected — no CIP fix yet (latest 4.19.325-cip136-rt50) |
| cip/4.4 | Affected — no CIP fix yet (latest 4.4.302-cip115) |
| cip/4.4-rt | Affected — no CIP fix yet (latest 4.4.302-cip115-rt63) |