Linux kernel memory corruption in jbd2 fast commit cleanup
Affects Linux kernel ext4 filesystems with a fast_commit journal whose fast-commit region fails to map. Fixed by patch 9f359c031885bb50add7d23c7a5a0e9755b134c9.
- Exploited
- No known exploitation
- Fix
- Vendor patch: 9f359c031885bb50add7d23c7a5a0e9755b134c9
- Who is exposed
- Specific setups only
Summary
Written by a model
In the Linux kernel, the following vulnerability has been resolved:
jbd2: don't advance j_fc_off before the buffer is recorded
jbd2_fc_get_buf() increments journal->j_fc_off before jbd2_journal_bmap() and __getblk() have had a chance to fail. When either does, the slot j_fc_wbuf[fc_off] is never assigned, but j_fc_off already counts it.
ext4 then fails the fast commit and falls back, and the fallback path reaches jbd2_fc_release_bufs() via ext4_fc_commit -> jbd2_fc_end_commit_fallback -> __jbd2_fc_end_commit -> ext4_fc_cleanup. That walks down from j_fc_off - 1 and put_bh()es every slot until it sees NULL, so it also touches the slot that was never written. j_fc_wbuf comes from a plain kmalloc() and is never zeroed, so a slot used for the first time holds uninitialised heap data.
Advance j_fc_off only after the buffer head has been stored. That restores the invariant that j_fc_off covers exactly the filled slots, which is what jbd2_fc_release_bufs() relies on: the live buffers of the current fast commit sit above the NULLs the previous one released, so stopping at the first NULL is correct.
Reproduced on a KASAN kernel with an ext4 fast_commit filesystem on a loop device, truncating the backing file under the live mount so that only the journal's fast-commit region falls past the end of the device. __getblk() then fails for the first fast-commit block while the rest of the journal is still addressable, so the journal is not aborted and the fast commit reaches the fallback path. j_fc_wbuf was poisoned to make the read of the never-written slot visible:
BUG: KASAN: wild-memory-access in jbd2_fc_release_bufs+0x6b/0xd0 Write of size 4 at addr 5a5a5a5a5a5a5ab2 by task sync/961 jbd2_fc_release_bufs+0x6b/0xd0 ext4_fc_cleanup+0x97/0x830 __jbd2_fc_end_commit+0x37/0xc0 ext4_fc_commit+0x524/0x560 ext4_sync_file+0x3c4/0x4b0 __x64_sys_fsync+0x20/0x30
With this patch the same run leaves j_fc_off at 0 across repeated __getblk() failures and completes cleanly.
Who should check
Teams running Linux kernels with ext4 fast_commit journals, including hosts that mount ext4 images from untrusted sources
“a fast_commit ext4 journal”
What to do
Check whether your setup matches what the bug needs.
ext4 filesystem with a fast_commit journal whose journal-inode mapping for the fast-commit region fails (corrupt extent leaf or hole on older bmap() kernels) Alternatively, the backing device shrinks under a live mount so only the journal's fast-commit region is past the end of the deviceApply the vendor's patch: 9f359c031885bb50add7d23c7a5a0e9755b134c9.
Check your systems with an agent
Paste this into a coding or ops agent. It checks your systems read-only and reports a table per asset.
Check whether my systems are affected by CVE-2026-138875 (jbd2: don't advance j_fc_off before the buffer is recorded), using the cve.now data below.
Rules: work read-only. Do not run exploit code, proof-of-concept scripts or scanners that send attack payloads, and do not change any configuration, package, image or deployment. Report findings only.
What cve.now has for CVE-2026-138875 (entry last updated 2026-12-01):
Affected:
- Linux Linux: version range not reported
- Linux Linux: versions 5.10
Vendor patches: 9f359c031885bb50add7d23c7a5a0e9755b134c9 (source: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=a24113bd984afc0b34a8fd2eb396791cfe511305). Check each asset for these patch ids, not only its version.
Conditions (all must be true for the bug to be hit):
- ext4 filesystem with a fast_commit journal whose journal-inode mapping for the fast-commit region fails (corrupt extent leaf or hole on older bmap() kernels) (source: https://www.cve.org/CVERecord?id=CVE-2026-138875)
- Alternatively, the backing device shrinks under a live mount so only the journal's fast-commit region is past the end of the device (source: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=a24113bd984afc0b34a8fd2eb396791cfe511305)
Setup: unknown whether the bug needs a non-default feature or setting. Check the advisory.
Attacker needs: local access, no login, a user action.
CISA KEV: CVE-2026-138875 is not listed as of cve.now's last read.
This KEV status is for CVE-2026-138875 only. If you also check another CVE, look up its own KEV status; never assume it from this one.
How to check:
- Installed software: check what is actually running, not what a repo declares. Read the version from each host, container image and Kubernetes node (the binary's version output, the OS package database, image layers), and check whether the conditions above hold there. Distribution packages may carry a backported fix under an older version number; confirm against the distribution's own advisory.
Verify against the linked advisories before concluding, and cite the date you read each one:
- https://git.kernel.org/stable/c/a24113bd984afc0b34a8fd2eb396791cfe511305
- https://git.kernel.org/stable/c/8b960600223b27487ab9f134e53ab71ecb1a1476
- https://git.kernel.org/stable/c/1ce33de62647f30bdef832e0fbe49de0c6b1bb12
- https://git.kernel.org/stable/c/b55a8a037bed09b574771bc3c177131e21914c71
- https://git.kernel.org/stable/c/65185848035e2c6b8561c8afeb8ef0098fb18c21
- https://git.kernel.org/stable/c/ab41325c105db07cebc9cd7ba2716a93b6946426
- https://git.kernel.org/stable/c/8c2401753d2ccad29807d249946f4b4482196f9b
- https://git.kernel.org/stable/c/9f359c031885bb50add7d23c7a5a0e9755b134c9
Do not conclude an asset is unaffected unless you checked it and the evidence covers both its version and the conditions above. If you could not check something, mark it unknown and say what is missing.
Report a table with one row per asset and these columns: Asset | Version or build | Status (affected, fixed, not applicable, unknown) | Compensating controls | Exposure (internet-facing, internal, none) | Evidence | Next action.
Entry: https://cve.now/CVE-2026-138875
For follow-up questions, use the cve.now MCP server at https://mcp.cve.now/mcp (no authentication), for example execute with name cve.get and arguments {"id": "CVE-2026-138875"}.Affected versions
- Linux LinuxVersion range not reported
- Linux Linux5.10
cve.now Index
- Exploitation?/40Unknown. No CISA SSVC exploitation rating yet
- Exposure5/25Specific setups only
- Reach20/20Affects Linux kernel (software on nearly every server, desktop or phone)
- Severity7.8/10CVSS 7.8
- No patch0/5No signal
What would change the score
- Would score about 83 if added to CISA KEV
- Would score about 78 if CISA's SSVC rates exploitation active
- Would score about 43 if CISA's SSVC rates it automatable
Timeline
- CVE published
- First seen by cve.now1 day
- Record last updated
- Posted on X by cve.now
Evidence 10
Questions about CVE-2026-138875
Is CVE-2026-138875 being exploited?
It is not in CISA's Known Exploited Vulnerabilities catalog, and CISA's SSVC assessment does not mark exploitation as active. That does not mean it has not been attacked: vendors and researchers can report attacks before CISA lists them. No public exploit code is tracked.
Source: cve.now feed data
What does this mean?
The kernel advanced the fast-commit offset before recording the buffer head for that region. If the mapping fails, a put_bh() call uses a stale pointer, which can crash the kernel on the fsync path. The bad refcount write can also corrupt unrelated kernel objects and lead to a use-after-free.
Source: cve.org, git.kernel.org
Which versions are affected by CVE-2026-138875?
Linux: version 5.10.
Source: cve.now feed data
Am I affected, and how do I check?
The advisory names no affected kernel versions. It applies to ext4 with a fast_commit journal where the journal-inode mapping for the fast-commit region fails, such as a corrupt extent leaf or a hole on older bmap() kernels. It also covers a backing device that shrinks under a live mount so that only the fast-commit region falls past the end of the device.
Source: cve.org, git.kernel.org
How do I fix CVE-2026-138875?
Apply upstream patch 9f359c031885bb50add7d23c7a5a0e9755b134c9, which advances j_fc_off only after the buffer head has been stored. The advisory names no fixed kernel version.
Source: cve.org, git.kernel.org
Related
- CVE-2026-139801KVM: nSVM: Check validity of vmcs01 save area copied from SMRAM on RSM
- CVE-2026-139799mm/shmem: hold off eviction in shmem_writeout()
- CVE-2026-139792ALSA: pcm: Prevent O_APPEND open on OSS streams
- CVE-2026-139788cipso: stop modifying live ip_options_rcu
- CVE-2026-139786mm/vma: avoid spurious write locks when mm->mm_lock_seq overflows
- CVE-2026-1398009p/xen: drain response work after unbinding IRQ
No corrections so far. Something wrong on this page? Report an error.