diff options
| author | Junzhe Yu <junzheyu1@gmail.com> | 2026-08-04 12:55:33 +0800 |
|---|---|---|
| committer | Theodore Ts'o <tytso@mit.edu> | 2026-08-06 10:34:27 -0400 |
| commit | 8f3901fbb40745046e513226ad84e8b84492632d (patch) | |
| tree | 6c2873f704620228930ff49c6e03eaf39d788fed /scripts/Makefile.thinlto | |
| parent | 5aa98f874c013bcce9bb84ffded2f0ef886e4e33 (diff) | |
| download | linux-stable-8f3901fbb40745046e513226ad84e8b84492632d.tar.gz linux-stable-8f3901fbb40745046e513226ad84e8b84492632d.zip | |
ext4: guard against NULL s_group_info in ext4_get_group_info
Resend: previous attempt was rejected by vger for containing HTML.
==================================================================
ext4_mark_group_bitmap_corrupted() already treats a NULL return from
ext4_get_group_info() as "nothing to do", but ext4_get_group_info()
indexes s_group_info without checking whether the array exists.
During mount, fast-commit replay runs inside jbd2_journal_load() from
ext4_load_and_init_journal(), which is before ext4_mb_init() allocates
s_group_info. Replaying an FC UNLINK for an inode whose bitmap bit is
already clear takes:
ext4_fc_replay_unlink -> iput -> ext4_evict_inode -> ext4_free_inode
-> ext4_mark_group_bitmap_corrupted -> ext4_get_group_info
and faults on the NULL s_group_info base. Userspace only mounts a dirty
ext4 image; this is a supported recovery path.
Return NULL when s_group_info (or the per-block grp_info row) is unset
so the existing caller check is effective during early mount.
Tested on Linux v6.6.145 KASAN: crafted FC-unlink image previously
triggered KASAN null-ptr-deref / panic in ext4_get_group_info; with this
patch, mount succeeds (EXT4 "bit already cleared" may still log). Also
observed on v6.6.144; still present on torvalds/linux as of
f5098b6bae76 (2026-07-26).
A self-contained Docker/QEMU reproducer (craft + mount + patch verify) is
available on request.
Signed-off-by: Yu Junzhe <junzheyu1@gmail.com>
Link: https://patch.msgid.link/65c955b0-716b-4599-b925-59c2782e38b4@gmail.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'scripts/Makefile.thinlto')
0 files changed, 0 insertions, 0 deletions
