CVE-2026-80807: nilfs2: reject invalid block index in GC ioctl
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 listaddtail() call on bh->bassocbuffers within nilfslookupdirtydatabuffers().
Analysis revealed that the root cause was the insertion of a page/folio with a page index of ULONGMAX into the page cache via the GC ioctl. filemapgetfoliostag(), called by nilfslookupdirtydatabuffers(), repeatedly detects a dirty folio with a page index of ULONGMAX 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 nilfsvdesc structure passed as an argument. Normally, this does not cause issues because the user-space GC library configures the nilfsvdesc 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 ULONGMAX, triggering the above problem.
This resolves the issue by checking the ranges of 'vdoffset' and 'vdvblocknr' in the nilfsvdesc structure that determine the page index, thereby preventing the invalid page/folio insertions.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
Linux kernel (nilfs2)to a version that resolves this vulnerability.Fixed in nilfs2: reject invalid block index in GC ioctl
Event History
Frequently Asked Questions
What access does an attacker need to trigger this issue?
An attacker needs the ability to submit crafted nilfs2 garbage-collection ioctl requests. The malformed nilfs_vdesc parameters cause a page or folio with an ULONG_MAX page index to be inserted into the page cache.
Which systems are exposed?
Systems using the Linux kernel with the nilfs2 filesystem and its GC ioctl interface are relevant. The issue is not expected during normal garbage collection, because the user-space GC library normally supplies valid nilfs_vdesc values.
What is the effect of a successful trigger?
The crafted request can cause page-index wrap-around during dirty-folio lookup, resulting in repeated processing of dirty buffers and a double list_add_tail() call. This leads to list corruption.
How can this be mitigated if an update cannot be applied immediately?
Restrict access to the nilfs2 GC ioctl and avoid allowing untrusted users or processes to issue garbage-collection requests with attacker-controlled nilfs_vdesc parameters.