CVE-2026-138875
published high CVSS 3.1 · 7.8jbd2: don't advance j_fc_off before the buffer is recorded
Package status and fixes
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| Linux | — | Linuxff780b91efe901b8eecd8114785abae5341820ad to < a24113bd984afc0b34a8fd2eb396791cfe511305 · ff780b91efe901b8eecd8114785abae5341820ad to < 8b960600223b27487ab9f134e53ab71ecb1a1476 · ff780b91efe901b8eecd8114785abae5341820ad to < 1ce33de62647f30bdef832e0fbe49de0c6b1bb12 · ff780b91efe901b8eecd8114785abae5341820ad to < b55a8a037bed09b574771bc3c177131e21914c71 · ff780b91efe901b8eecd8114785abae5341820ad to < 65185848035e2c6b8561c8afeb8ef0098fb18c21 · ff780b91efe901b8eecd8114785abae5341820ad to < ab41325c105db07cebc9cd7ba2716a93b6946426 · ff780b91efe901b8eecd8114785abae5341820ad to < 8c2401753d2ccad29807d249946f4b4482196f9b · ff780b91efe901b8eecd8114785abae5341820ad to < 9f359c031885bb50add7d23c7a5a0e9755b134c9 · Other versions: unaffected | Affected | Not stated | Linux |
| Linux | — | Linux5.10 (affected) · 0 to < 5.10 (unaffected · semver) · 5.10.275 through 5.10.* (unaffected · semver) · 5.15.226 through 5.15.* (unaffected · semver) · 6.1.193 through 6.1.* (unaffected · semver) · 6.6.163 through 6.6.* (unaffected · semver) · 6.12.117 through 6.12.* (unaffected · semver) · 6.18.63 through 6.18.* (unaffected · semver) · 7.3.4 through 7.3.* (unaffected · semver) · 7.4-rc1 and later (unaffected · original_commit_for_fix) · Other versions: affected | Version-specific | Not stated | Linux |
Description
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.
Related advisories
Vendor advisories explicitly linked to this CVE.
No linked advisories were found for this CVE.
Assessment
CVSS risk assessment and additional context for this vulnerability.
- CVSS version
- 3.1
- Base score
- 7.8 / 10
- Severity
- high
- Provider
- Linux · cna
- Vector string
- CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
- Scenarios
- en: AV:L - The bad state is on the mounted image: a fast_commit ext4 journal whose journal-inode mapping for the fast-commit region makes ext4_journal_bmap() fail (a corrupt extent leaf, or a hole on older bmap() kernels). A local fsync(2) triggers it via ext4_sync_file -> ext4_fc_commit -> ext4_fc_reserve_space -> jbd2_fc_get_buf(). No network protocol carries the malformed data. AC:L - The image author chooses the fast_commit flag, s_num_fc_blks and which journal block fails to map. So the first fast commit after the initial full commit always bumps j_fc_off without filling j_fc_wbuf[0], and the fallback ext4_fc_cleanup -> jbd2_fc_release_bufs() then put_bh()s that slot. No race or rare config is involved. PR:N - The attacker only supplies the crafted image. ext4_fs_type lacks FS_USERNS_MOUNT, so the mount needs init-ns CAP_SYS_ADMIN and counts as the victim's action, not an attacker privilege. The other trigger, shrinking the device under a live mount (LOOP_SET_CAPACITY), needs write access to the block device and is no easier. UI:R - Someone, a user or an automounter, has to mount the attacker-supplied fast_commit image, and a regular file on it then has to be written and fsync'd (ext4_fsync_journal only takes the fast-commit path for S_ISREG). That interaction is what reaches jbd2_fc_get_buf(). S:U - The damage is to kernel heap memory of the same kernel that mounted the image. jbd2/ext4 crosses no VM, IOMMU or sandbox boundary here. C:H - jbd2_journal_initialize_fast_commit() allocates j_fc_wbuf with an uninitialised kmalloc at mount, sized by the image's s_num_fc_blks. The never-written slot therefore holds stale heap data that can be groomed. Treating it as a buffer_head pointer is memory corruption that can be built into kernel read primitives, not a bounded leak. I:H - jbd2_fc_release_bufs() calls put_bh() on that stale pointer, an atomic_dec of b_count at an attacker-influenced wild address (KASAN reports a wild-memory-access write of size 4). That is enough to drop a refcount on an unrelated object and turn it into a use-after-free. A:H - With heap contents that weren't groomed, the put_bh() on the garbage pointer faults inside ext4_fc_cleanup() on the fsync path and oopses the kernel. The bmap-failure variant also aborts the journal.
Publisher product statements
Version ranges and default statuses as reported by each provider.
| Vendor | Product | Version status | Source |
|---|---|---|---|
| Linux | Linux | ff780b91efe901b8eecd8114785abae5341820ad to < a24113bd984afc0b34a8fd2eb396791cfe511305 (affected · git)ff780b91efe901b8eecd8114785abae5341820ad to < 8b960600223b27487ab9f134e53ab71ecb1a1476 (affected · git)ff780b91efe901b8eecd8114785abae5341820ad to < 1ce33de62647f30bdef832e0fbe49de0c6b1bb12 (affected · git)ff780b91efe901b8eecd8114785abae5341820ad to < b55a8a037bed09b574771bc3c177131e21914c71 (affected · git)ff780b91efe901b8eecd8114785abae5341820ad to < 65185848035e2c6b8561c8afeb8ef0098fb18c21 (affected · git)ff780b91efe901b8eecd8114785abae5341820ad to < ab41325c105db07cebc9cd7ba2716a93b6946426 (affected · git)ff780b91efe901b8eecd8114785abae5341820ad to < 8c2401753d2ccad29807d249946f4b4482196f9b (affected · git)ff780b91efe901b8eecd8114785abae5341820ad to < 9f359c031885bb50add7d23c7a5a0e9755b134c9 (affected · git)Default: unaffected | Linux · cna |
| Linux | Linux | 5.10 (affected)0 to < 5.10 (unaffected · semver)5.10.275 through 5.10.* (unaffected · semver)5.15.226 through 5.15.* (unaffected · semver)6.1.193 through 6.1.* (unaffected · semver)6.6.163 through 6.6.* (unaffected · semver)6.12.117 through 6.12.* (unaffected · semver)6.18.63 through 6.18.* (unaffected · semver)7.3.4 through 7.3.* (unaffected · semver)7.4-rc1 and later (unaffected · original_commit_for_fix)Default: affected | Linux · cna |
Weaknesses
0No weakness assertions.
References
8- https://git.kernel.org/stable/c/1ce33de62647f30bdef832e0fbe49de0c6b1bb12
- https://git.kernel.org/stable/c/65185848035e2c6b8561c8afeb8ef0098fb18c21
- https://git.kernel.org/stable/c/8b960600223b27487ab9f134e53ab71ecb1a1476
- https://git.kernel.org/stable/c/8c2401753d2ccad29807d249946f4b4482196f9b
- https://git.kernel.org/stable/c/9f359c031885bb50add7d23c7a5a0e9755b134c9
- https://git.kernel.org/stable/c/a24113bd984afc0b34a8fd2eb396791cfe511305
- https://git.kernel.org/stable/c/ab41325c105db07cebc9cd7ba2716a93b6946426
- https://git.kernel.org/stable/c/b55a8a037bed09b574771bc3c177131e21914c71
Provider assertions
1Linux · cna
jbd2: don't advance j_fc_off before the buffer is recorded
Provenance
- Schema
- 5.2
- Searchable
- yes
- Content hash
- 1122ad0498a7312d5ed9768cdd4ce57d8f6aa1e7016410135220c7596223f015
- Ingested
- 01 Dec 2026, 05:47:22 UTC
- Source record
- Official CVE record