CVE-2026-142842: ext4: fix fast commit replay failing on a read-only mount
In the Linux kernel, the following vulnerability has been resolved:
ext4: fix fast commit replay failing on a read-only mount
A filesystem with fastcommit that needs recovery cannot be mounted read-only:
EXT4-fs (dm-0): INFO: recovery required on readonly filesystem EXT4-fs (dm-0): write access will be enabled during recovery WARNING: CPU: 22 PID: 5544 at fs/ext4/ext4jbd2.c:73 ext4journalcheckstart ext4journalstartsb ext4unlink ext4fcreplay doonepass jbd2journalrecover jbd2journalload ext4fillsuper JBD2: journal recovery failed EXT4-fs (dm-0): error loading journal
Fast commit replay runs ext4 metadata operations instead of writing blocks through the buffer cache: ext4fcreplay{unlink,link,create}() reach ext4unlink() and ext4link(), which start a handle. ext4journalcheckstart() returns -EROFS on a read-only sb, and as that is not -ENOENT it propagates out of jbd2journalrecover() and kills the whole recovery. The EXT4FCREPLAY check that would hand out a no-journal handle sits after the sbrdonly() test, so replay can never complete read-only.
ext4loadjournal() has already promised that write access will be enabled during recovery, so make that true for the superblock as well: clear SBRDONLY across jbd2journalload() when recovery is needed on a read-only mount and the devices are writable, as ext4orphancleanup() does. Unlike ext4handleerror(), which avoids SBRDONLY because it would need sumount, the sb here is still inside ext4fillsuper() and not published, so nothing can observe it.
The failure is not clean either: the replay handlers passing a NULL handle (ext4fcreplayinode(), addrange(), delrange()) never hit ext4journalcheckstart() and do write, leaving a partially applied fast commit behind.
Reproducer, where the unlink only ever reaches the fast commit area:
mke2fs -q -F -t ext4 -O fastcommit -b 4096 /dev/sdb3 262144 mount /dev/sdb3 /mnt dd if=/dev/zero of=/mnt/victim bs=4k count=1 conv=fsync sync # victim now in a full commit rm /mnt/victim dd if=/dev/zero of=/mnt/trigger bs=4k count=1 conv=fsync <crash, or snapshot the device while mounted and write it back> mount -o ro /dev/sdb3 /mnt
Without this patch that mount fails; with it recovery completes and victim is gone, i.e. the UNLINK record was really replayed.
Affected Software
Event History
Frequently Asked Questions
Which systems are affected by this failure?
The issue affects ext4 filesystems using fast commits when journal recovery is required and the filesystem is mounted read-only. A read-only ext4 mount that does not require recovery is not described as affected.
How can I tell whether this condition is occurring?
The kernel log can report “recovery required on readonly filesystem,” followed by “write access will be enabled during recovery.” Failed recovery may also produce a warning from ext4_journal_check_start, “JBD2: journal recovery failed,” and “error loading journal.”},{
What is required for recovery to complete on an affected read-only mount?
Recovery needs write access to be enabled during the recovery process. The failure occurs because fast-commit replay attempts metadata operations while the superblock is treated as read-only.