[Android 6.1] KASAN: use-after-free Read in ext4_find_extent (2)

0 views
Skip to first unread message

syzbot

unread,
May 31, 2025, 11:45:29 AMMay 31
Hello,

syzbot found the following issue on:

HEAD commit: db710ea87c32 BACKPORT: mm: avoid unconditional one-tick sl..
git tree: android14-6.1
console+strace: https://syzkaller.appspot.com/x/log.txt?x=175e8ff4580000
kernel config: https://syzkaller.appspot.com/x/.config?x=62149ca91101e547
dashboard link: https://syzkaller.appspot.com/bug?extid=869401e856e234844286
compiler: Debian clang version 20.1.6 (++20250514063057+1e4d39e07757-1~exp1~20250514183223.118), Debian LLD 20.1.6
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=15417482580000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=103bded4580000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/34e0e938b0cc/disk-db710ea8.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/aa7b00cb205a/vmlinux-db710ea8.xz
kernel image: https://storage.googleapis.com/syzbot-assets/acf5e1aff905/bzImage-db710ea8.xz
mounted in repro: https://storage.googleapis.com/syzbot-assets/8236d6831927/mount_0.gz
fsck result: failed (log: https://syzkaller.appspot.com/x/fsck.log?x=14b0c00c580000)

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: [email protected]

==================================================================
BUG: KASAN: use-after-free in ext4_ext_binsearch fs/ext4/extents.c:837 [inline]
BUG: KASAN: use-after-free in ext4_find_extent+0xbeb/0xe20 fs/ext4/extents.c:953
Read of size 4 at addr ffff88811744d018 by task kworker/u4:3/296

CPU: 0 PID: 296 Comm: kworker/u4:3 Not tainted 6.1.138-syzkaller-00046-gdb710ea87c32 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025
Workqueue: writeback wb_workfn (flush-7:0)
Call Trace:
<TASK>
__dump_stack+0x21/0x24 lib/dump_stack.c:88
dump_stack_lvl+0xee/0x150 lib/dump_stack.c:106
print_address_description+0x71/0x210 mm/kasan/report.c:316
print_report+0x4a/0x60 mm/kasan/report.c:427
kasan_report+0x122/0x150 mm/kasan/report.c:531
__asan_report_load4_noabort+0x14/0x20 mm/kasan/report_generic.c:350
ext4_ext_binsearch fs/ext4/extents.c:837 [inline]
ext4_find_extent+0xbeb/0xe20 fs/ext4/extents.c:953
ext4_ext_map_blocks+0x1dc/0x6060 fs/ext4/extents.c:4165
ext4_map_blocks+0x9cb/0x1b60 fs/ext4/inode.c:679
mpage_map_one_extent fs/ext4/inode.c:2435 [inline]
mpage_map_and_submit_extent fs/ext4/inode.c:2488 [inline]
ext4_writepages+0x1260/0x3020 fs/ext4/inode.c:2856
do_writepages+0x3a9/0x5e0 mm/page-writeback.c:2494
__writeback_single_inode+0xc6/0xad0 fs/fs-writeback.c:1612
writeback_sb_inodes+0x9b8/0x1550 fs/fs-writeback.c:1903
wb_writeback+0x3f1/0x980 fs/fs-writeback.c:2079
wb_do_writeback fs/fs-writeback.c:2226 [inline]
wb_workfn+0x350/0xda0 fs/fs-writeback.c:2266
process_one_work+0x71f/0xc40 kernel/workqueue.c:2299
worker_thread+0xa29/0x11f0 kernel/workqueue.c:2446
kthread+0x281/0x320 kernel/kthread.c:386
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295
</TASK>

The buggy address belongs to the physical page:
page:ffffea00045d1340 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x11744d
flags: 0x4000000000000000(zone=1)
raw: 4000000000000000 ffffea00045d1348 ffffea00045d1348 0000000000000000
raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner info is not present (never set?)

Memory state around the buggy address:
ffff88811744cf00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff88811744cf80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff88811744d000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
^
ffff88811744d080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff88811744d100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
==================================================================
EXT4-fs error (device loop0): ext4_ext_split:1080: inode #15: comm kworker/u4:3: p_ext > EXT_MAX_EXTENT!
EXT4-fs (loop0): Delayed block allocation failed for inode 15 at logical offset 0 with max blocks 1 with error 1


---
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 [email protected].

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