CVE-2026-139389: ocfs2: validate chunk and block counts of the local quota file
In the Linux kernel, the following vulnerability has been resolved:
ocfs2: validate chunk and block counts of the local quota file
ocfs2localreadinfo() trusts dqichunks and dqiblocks from the local quota file header. If dqiblocks is too small, ocfs2extendlocalquotafile() computes a bogus chunk length, extends the file, and maps logical block dqiblocks, which is already in the inode's metadata cache (the header or a chunk header read at mount). sbgetblk() returns that cached buffer and ocfs2setnewbufferuptodate() hits BUGON(ocfs2buffercached()):
kernel BUG at fs/ocfs2/uptodate.c:509! ocfs2extendlocalquotafile+0x45c/0x1100 ocfs2createlocaldquot+0x8ac/0xb50 ocfs2acquiredquot+0x614/0xae0 ocfs2getinitinode+0xe9/0x1b0 ocfs2mkdir+0x174/0x430
ocfs2localquotaaddchunk() has the same exposure.
Reject a header whose counts don't fit the chunk layout or exceed isize.
Reproduced with a crafted image (dqiblocks = 1, chunk 0 dqcfree = 0); syzbot has no reproducer for this report.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 5.10.275 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 5.15.226 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.1.193 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.6.163 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.12.119 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.18.65 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 7.3.6 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 7.3.6-1 - Compensating control
Reject local quota file headers whose chunk or block counts do not fit the chunk layout or exceed i_size.
Event History
Frequently Asked Questions
What conditions are required to trigger the failure?
The system must mount or otherwise use an OCFS2 local quota file with a crafted or corrupted header whose dqi_chunks or dqi_blocks values are inconsistent with the chunk layout or exceed the file's i_size. The reported reproducer uses dqi_blocks = 1 with chunk 0 dqc_free = 0, and the failure is reached during quota activity such as mkdir.
What is the practical impact of a malformed local quota file?
A too-small dqi_blocks value can cause OCFS2 to calculate an invalid chunk length and reuse a metadata-cached buffer while extending the quota file. This triggers a kernel BUG in ocfs2_set_new_buffer_uptodate(), which can crash the kernel.
How can administrators identify potentially affected quota files?
Check OCFS2 local quota file headers for dqi_chunks and dqi_blocks values that do not fit the expected chunk layout or that describe blocks beyond the quota file's i_size. Such headers should be treated as malformed.
What can be done before applying the fix?
Avoid mounting or performing quota operations on OCFS2 filesystems with untrusted, corrupted, or suspected malformed local quota files. Validate or restore the affected filesystem and quota metadata from a known-good source before use.