[Android 5.10] KASAN: use-after-free Read in ext4_ext_try_to_merge_right

0 views
Skip to first unread message

syzbot

unread,
Mar 30, 2026, 4:18:29 PM (4 days ago) Mar 30
to syzkaller-a...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: cc0ae2abdc73 Merge android13-5.10 into android13-5.10-lts
git tree: android13-5.10-lts
console output: https://syzkaller.appspot.com/x/log.txt?x=15332650580000
kernel config: https://syzkaller.appspot.com/x/.config?x=a785e77f3e5809cd
dashboard link: https://syzkaller.appspot.com/bug?extid=e43fa000c0203108ea6d
compiler: Debian clang version 21.1.8 (++20251221033036+2078da43e25a-1~exp1~20251221153213.50), Debian LLD 21.1.8
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=153429ca580000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=17f84bd6580000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/759ecbff30f3/disk-cc0ae2ab.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/e3d7437fe921/vmlinux-cc0ae2ab.xz
kernel image: https://storage.googleapis.com/syzbot-assets/116ef28bb3dd/bzImage-cc0ae2ab.xz
mounted in repro: https://storage.googleapis.com/syzbot-assets/2ffa5be898d0/mount_3.gz
fsck result: failed (log: https://syzkaller.appspot.com/x/fsck.log?x=17ba51ca580000)

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+e43fa0...@syzkaller.appspotmail.com

==================================================================
BUG: KASAN: use-after-free in ext4_ext_try_to_merge_right+0x416/0x820 fs/ext4/extents.c:1819
Read of size 718788 at addr ffff888112b16460 by task syz.0.601/3407

CPU: 0 PID: 3407 Comm: syz.0.601 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2026
Call Trace:
__dump_stack+0x21/0x24 lib/dump_stack.c:77
dump_stack_lvl+0x1a7/0x208 lib/dump_stack.c:118
print_address_description+0x7f/0x2c0 mm/kasan/report.c:248
__kasan_report mm/kasan/report.c:435 [inline]
kasan_report+0xe2/0x130 mm/kasan/report.c:452
check_region_inline mm/kasan/generic.c:-1 [inline]
kasan_check_range+0x249/0x2a0 mm/kasan/generic.c:189
memmove+0x2d/0x70 mm/kasan/shadow.c:54
ext4_ext_try_to_merge_right+0x416/0x820 fs/ext4/extents.c:1819
ext4_ext_shift_path_extents fs/ext4/extents.c:5125 [inline]
ext4_ext_shift_extents+0xd24/0x14a0 fs/ext4/extents.c:5302
ext4_collapse_range fs/ext4/extents.c:5436 [inline]
ext4_fallocate+0x109c/0x1a70 fs/ext4/extents.c:4769
vfs_fallocate+0x4b4/0x590 fs/open.c:310
ksys_fallocate fs/open.c:333 [inline]
__do_sys_fallocate fs/open.c:341 [inline]
__se_sys_fallocate fs/open.c:339 [inline]
__x64_sys_fallocate+0xc0/0x110 fs/open.c:339
do_syscall_64+0x31/0x40 arch/x86/entry/common.c:46
entry_SYSCALL_64_after_hwframe+0x61/0xcb
RIP: 0033:0x7f7618b28819
Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f761898b028 EFLAGS: 00000246 ORIG_RAX: 000000000000011d
RAX: ffffffffffffffda RBX: 00007f7618da1fa0 RCX: 00007f7618b28819
RDX: 0000000000004000 RSI: 0000000000000008 RDI: 0000000000000007
RBP: 00007f7618bbec91 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000008000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f7618da2038 R14: 00007f7618da1fa0 R15: 00007ffee766ac38

The buggy address belongs to the page:
page:ffffea00044ac580 refcount:2 mapcount:0 mapping:ffff888109199390 index:0x20 pfn:0x112b16
aops:def_blk_aops ino:0
flags: 0x400000000002203e(referenced|uptodate|dirty|lru|active|private|mappedtodisk)
raw: 400000000002203e ffffea0004820388 ffffea00046a4cc8 ffff888109199390
raw: 0000000000000020 ffff8881321855e8 00000002ffffffff ffff888100142000
page dumped because: kasan: bad access detected
page->mem_cgroup:ffff888100142000
page_owner tracks the page as allocated
page last allocated via order 0, migratetype Unmovable, gfp_mask 0x112cc0(GFP_USER|__GFP_NOWARN|__GFP_NORETRY), pid 297, ts 116438699098, free_ts 116375815968
set_page_owner include/linux/page_owner.h:35 [inline]
post_alloc_hook mm/page_alloc.c:2456 [inline]
prep_new_page+0x179/0x180 mm/page_alloc.c:2462
get_page_from_freelist+0x223b/0x23d0 mm/page_alloc.c:4254
__alloc_pages_nodemask+0x290/0x620 mm/page_alloc.c:5384
__alloc_pages include/linux/gfp.h:544 [inline]
__alloc_pages_node include/linux/gfp.h:557 [inline]
alloc_pages_node include/linux/gfp.h:571 [inline]
alloc_pages include/linux/gfp.h:590 [inline]
__page_cache_alloc include/linux/pagemap.h:290 [inline]
page_cache_ra_unbounded+0x2dc/0x7e0 mm/readahead.c:226
do_page_cache_ra mm/readahead.c:277 [inline]
force_page_cache_ra+0x3a9/0x400 mm/readahead.c:308
page_cache_sync_ra+0x237/0x2a0 mm/readahead.c:582
page_cache_sync_readahead include/linux/pagemap.h:837 [inline]
generic_file_buffered_read+0x574/0x2770 mm/filemap.c:2250
generic_file_read_iter+0x11e/0x5c0 mm/filemap.c:2568
blkdev_read_iter+0x12f/0x160 fs/block_dev.c:1956
call_read_iter include/linux/fs.h:2060 [inline]
new_sync_read fs/read_write.c:415 [inline]
vfs_read+0x62a/0xa60 fs/read_write.c:496
ksys_read+0x149/0x250 fs/read_write.c:634
__do_sys_read fs/read_write.c:644 [inline]
__se_sys_read fs/read_write.c:642 [inline]
__x64_sys_read+0x7b/0x90 fs/read_write.c:642
do_syscall_64+0x31/0x40 arch/x86/entry/common.c:46
entry_SYSCALL_64_after_hwframe+0x61/0xcb
page last free stack trace:
reset_page_owner include/linux/page_owner.h:28 [inline]
free_pages_prepare mm/page_alloc.c:1349 [inline]
free_pcp_prepare mm/page_alloc.c:1421 [inline]
free_unref_page_prepare+0x2b7/0x2d0 mm/page_alloc.c:3336
free_unref_page_list+0x129/0x9c0 mm/page_alloc.c:3443
release_pages+0xe52/0xea0 mm/swap.c:1103
free_pages_and_swap_cache+0x86/0xa0 mm/swap_state.c:356
tlb_batch_pages_flush mm/mmu_gather.c:49 [inline]
tlb_flush_mmu_free mm/mmu_gather.c:240 [inline]
tlb_flush_mmu mm/mmu_gather.c:247 [inline]
tlb_finish_mmu+0x17e/0x310 mm/mmu_gather.c:326
exit_mmap+0x329/0x590 mm/mmap.c:3387
__mmput+0x93/0x2f0 kernel/fork.c:1153
mmput+0x4e/0x150 kernel/fork.c:1176
exit_mm kernel/exit.c:539 [inline]
do_exit+0x9ec/0x2500 kernel/exit.c:859
do_group_exit+0x141/0x310 kernel/exit.c:986
get_signal+0xf7d/0x12e0 kernel/signal.c:2793
arch_do_signal_or_restart+0xe2/0x11d0 arch/x86/kernel/signal.c:805
handle_signal_work kernel/entry/common.c:145 [inline]
exit_to_user_mode_loop+0xa2/0xe0 kernel/entry/common.c:169
exit_to_user_mode_prepare+0x76/0xa0 kernel/entry/common.c:199
syscall_exit_to_user_mode+0x1d/0x40 kernel/entry/common.c:274
do_syscall_64+0x3d/0x40 arch/x86/entry/common.c:56

Memory state around the buggy address:
ffff888112b17f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff888112b17f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff888112b18000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff888112b18080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888112b18100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup
Reply all
Reply to author
Forward
0 new messages