syzbot


KASAN: use-after-free Read in ext4_find_extent

Status: upstream: reported C repro on 2022/12/26 07:59
Bug presence: origin:lts
Subsystems: ext4
[Documentation on labels]
Reported-by: syzbot+0827b4b52b5ebf65f219@syzkaller.appspotmail.com
First crash: 889d, last: 2d12h
Cause bisection: failed (error log, bisect log)
  
Discussions (2)
Title Replies (including bot) Last reply
[PATCH v2] ext4: Fix possible use-after-free in ext4_find_extent 6 (6) 2023/01/02 05:41
[PATCH] ext4: Fix possible use-after-free in ext4_find_extent 2 (2) 2022/12/29 22:40
Bug presence (2)
Date Name Commit Repro Result
2023/09/22 lts (merge base) aff03380bda4 C [report] kernel BUG in ext4_writepages
2023/09/22 upstream (ToT) 27bbf45eae9c C Didn't crash
Similar bugs (10)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
android-54 KASAN: use-after-free Read in ext4_find_extent C 1 73d 87d 0/2 upstream: reported C repro on 2025/02/13 21:05
android-5-10 KASAN: use-after-free Read in ext4_find_extent ext4 C error inconclusive 34 9d15h 868d 0/2 upstream: reported C repro on 2022/12/26 07:59
android-6-1 KASAN: use-after-free Read in ext4_find_extent missing-backport C error done 3 197d 694d 0/2 auto-obsoleted due to no activity on 2025/02/04 04:57
linux-5.15 KASAN: use-after-free Read in ext4_find_extent origin:lts-only C inconclusive 7 5d05h 663d 0/3 upstream: reported C repro on 2023/07/19 14:49
upstream KASAN: use-after-free Read in ext4_find_extent ext4 2 1300d 1361d 0/28 auto-closed as invalid on 2022/02/17 05:19
linux-6.1 KASAN: use-after-free Read in ext4_find_extent origin:upstream missing-backport C done 1 378d 601d 0/3 upstream: reported C repro on 2023/09/19 00:11
upstream KASAN: use-after-free Read in ext4_find_extent (2) ext4 C error 2 738d 863d 22/28 fixed on 2023/06/08 14:41
upstream KASAN: use-after-free Read in ext4_find_extent (4) ext4 C done 38 2d11h 132d 0/28 upstream: reported C repro on 2024/12/30 20:06
upstream KASAN: use-after-free Read in ext4_find_extent (3) prio:low ext4 C error done 31 503d 685d 25/28 fixed on 2024/01/30 23:26
android-54 KASAN: slab-out-of-bounds Read in ext4_find_extent ext4 C 1 682d 868d 0/2 auto-obsoleted due to no activity on 2023/10/08 03:20
Last patch testing requests (11)
Created Duration User Patch Repo Result
2025/04/29 07:46 34m retest repro android13-5.15-lts report log
2025/04/14 17:34 6m retest repro android13-5.15-lts report log
2025/03/31 12:28 6m retest repro android13-5.15-lts report log
2025/03/16 14:20 5m retest repro android13-5.15-lts report log
2025/03/16 14:20 1h04m retest repro android13-5.15-lts report log
2025/03/16 14:20 5m retest repro android13-5.15-lts report log
2025/03/16 14:20 6m retest repro android13-5.15-lts report log
2025/03/01 03:20 20m retest repro android13-5.15-lts report log
2022/12/28 14:25 13m tudor.ambarus@linaro.org https://github.com/ambarus/linux.git 5ee4e1b578324fdfde35eaf5ceb30a19336c97f6 OK log
2022/12/28 13:48 7m tudor.ambarus@linaro.org upstream report log
2022/12/28 13:47 13m tudor.ambarus@linaro.org https://github.com/ambarus/linux.git f3c76c42a554367d313d2e315676b19535089ac3 OK log
Fix bisection attempts (7)
Created Duration User Patch Repo Result
2024/05/16 00:06 40m bisect fix android13-5.15-lts OK (0) job log log
2023/10/23 19:44 42m bisect fix android13-5.15-lts OK (0) job log log
2023/07/31 02:16 55m bisect fix android13-5.15-lts OK (0) job log log
2023/06/01 08:00 16m bisect fix android13-5.15-lts OK (0) job log log
2023/05/01 12:38 18m bisect fix android13-5.15-lts OK (0) job log log
2023/03/04 00:47 18m bisect fix android13-5.15-lts OK (0) job log log
2023/02/01 21:22 28m bisect fix android13-5.15-lts OK (0) job log log

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in ext4_ext_binsearch fs/ext4/extents.c:827 [inline]
BUG: KASAN: use-after-free in ext4_find_extent+0xbeb/0xe20 fs/ext4/extents.c:946
Read of size 4 at addr ffff888112f84610 by task syz-executor593/290

CPU: 1 PID: 290 Comm: syz-executor593 Not tainted 5.15.181-syzkaller-00405-gf93c8b5a9e60 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/19/2025
Call Trace:
 <TASK>
 __dump_stack+0x21/0x30 lib/dump_stack.c:88
 dump_stack_lvl+0xee/0x150 lib/dump_stack.c:106
 print_address_description+0x7f/0x2c0 mm/kasan/report.c:248
 __kasan_report mm/kasan/report.c:427 [inline]
 kasan_report+0xf1/0x140 mm/kasan/report.c:444
 __asan_report_load4_noabort+0x14/0x20 mm/kasan/report_generic.c:308
 ext4_ext_binsearch fs/ext4/extents.c:827 [inline]
 ext4_find_extent+0xbeb/0xe20 fs/ext4/extents.c:946
 ext4_ext_remove_space+0x2bc/0x4180 fs/ext4/extents.c:2831
 ext4_punch_hole+0x77c/0xbd0 fs/ext4/inode.c:4131
 ext4_fallocate+0x2b6/0x1de0 fs/ext4/extents.c:4763
 vfs_fallocate+0x4b4/0x590 fs/open.c:309
 ksys_fallocate fs/open.c:332 [inline]
 __do_sys_fallocate fs/open.c:340 [inline]
 __se_sys_fallocate fs/open.c:338 [inline]
 __x64_sys_fallocate+0xc0/0x110 fs/open.c:338
 x64_sys_call+0x7ec/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:286
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x66/0xd0
RIP: 0033:0x7fea8e6f0c09
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 b1 18 00 00 90 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 b0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fea8e687168 EFLAGS: 00000246 ORIG_RAX: 000000000000011d
RAX: ffffffffffffffda RBX: 00007fea8e779718 RCX: 00007fea8e6f0c09
RDX: 0000000000000000 RSI: 0000000000000003 RDI: 0000000000000004
RBP: 00007fea8e779710 R08: 00007fea8e6876c0 R09: 0000000000000000
R10: 0000000000001a00 R11: 0000000000000246 R12: 00007fea8e77971c
R13: 000000000000006e R14: 00007fff58981830 R15: 00007fff58981918
 </TASK>

The buggy address belongs to the page:
page:ffffea00044be100 refcount:0 mapcount:0 mapping:0000000000000000 index:0x1 pfn:0x112f84
flags: 0x4000000000000000(zone=1)
raw: 4000000000000000 ffffea00044bdfc8 ffffea00044be208 0000000000000000
raw: 0000000000000001 0000000000000000 00000000ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as freed
page last allocated via order 0, migratetype Movable, gfp_mask 0x100dca(GFP_HIGHUSER_MOVABLE|__GFP_ZERO), pid 272, ts 22960372679, free_ts 22984140913
 set_page_owner include/linux/page_owner.h:33 [inline]
 post_alloc_hook+0x192/0x1b0 mm/page_alloc.c:2605
 prep_new_page+0x1c/0x110 mm/page_alloc.c:2611
 get_page_from_freelist+0x2cc5/0x2d50 mm/page_alloc.c:4485
 __alloc_pages+0x18f/0x440 mm/page_alloc.c:5781
 __alloc_pages_node include/linux/gfp.h:591 [inline]
 alloc_pages_node include/linux/gfp.h:605 [inline]
 alloc_pages include/linux/gfp.h:618 [inline]
 do_anonymous_page mm/memory.c:4068 [inline]
 handle_pte_fault+0xe89/0x2680 mm/memory.c:4908
 __handle_mm_fault mm/memory.c:-1 [inline]
 do_handle_mm_fault+0x1a6d/0x1d50 mm/memory.c:5332
 handle_mm_fault include/linux/mm.h:1836 [inline]
 do_user_addr_fault+0x841/0x1180 arch/x86/mm/fault.c:1418
 handle_page_fault arch/x86/mm/fault.c:1509 [inline]
 exc_page_fault+0x51/0xb0 arch/x86/mm/fault.c:1565
 asm_exc_page_fault+0x27/0x30 arch/x86/include/asm/idtentry.h:606
page last free stack trace:
 reset_page_owner include/linux/page_owner.h:26 [inline]
 free_pages_prepare mm/page_alloc.c:1472 [inline]
 free_pcp_prepare mm/page_alloc.c:1544 [inline]
 free_unref_page_prepare+0x542/0x550 mm/page_alloc.c:3534
 free_unref_page_list+0x134/0x9d0 mm/page_alloc.c:3671
 release_pages+0x1076/0x10d0 mm/swap.c:1009
 free_pages_and_swap_cache+0x86/0xa0 mm/swap_state.c:320
 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+0x175/0x300 mm/mmu_gather.c:338
 unmap_region+0x315/0x360 mm/mmap.c:2680
 __do_munmap+0xa0e/0xfe0 mm/mmap.c:2913
 __vm_munmap+0x15b/0x2a0 mm/mmap.c:2966
 __do_sys_munmap mm/mmap.c:2992 [inline]
 __se_sys_munmap mm/mmap.c:2988 [inline]
 __x64_sys_munmap+0x6b/0x80 mm/mmap.c:2988
 x64_sys_call+0xc9/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:12
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x66/0xd0

Memory state around the buggy address:
 ffff888112f84500: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff888112f84580: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff888112f84600: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
                         ^
 ffff888112f84680: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff888112f84700: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
==================================================================
EXT4-fs error (device loop0) in ext4_reserve_inode_write:5866: Corrupt filesystem
EXT4-fs (loop0): Remounting filesystem read-only
EXT4-fs error (device loop0): ext4_dirty_inode:6070: inode #18: comm syz-executor593: mark_inode_dirty error
EXT4-fs (loop0): Remounting filesystem read-only
EXT4-fs error (device loop0): ext4_read_block_bitmap_nowait:476: comm syz-executor593: Invalid block bitmap block 0 in block_group 0
EXT4-fs (loop0): Remounting filesystem read-only
EXT4-fs error (device loop0) in ext4_reserve_inode_write:5866: Corrupt filesystem
EXT4-fs (loop0): Remounting filesystem read-only
EXT4-fs error (device loop0): ext4_dirty_inode:6070: inode #18: comm syz-executor593: mark_inode_dirty error
EXT4-fs (loop0): Remounting filesystem read-only
EXT4-fs error (device loop0) in ext4_reserve_inode_write:5866: Corrupt filesystem
EXT4-fs (loop0): Remounting filesystem read-only
EXT4-fs error (device loop0): ext4_punch_hole:4144: inode #18: comm syz-executor593: mark_inode_dirty error
EXT4-fs (loop0): Remounting filesystem read-only

Crashes (12):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/05/10 04:12 android13-5.15-lts f93c8b5a9e60 77908e5f .config console log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro (corrupt fs)] ci2-android-5-15 KASAN: use-after-free Read in ext4_find_extent
2025/03/31 16:29 android13-5.15-lts 5e1b899f19c3 d3999433 .config console log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro (corrupt fs)] ci2-android-5-15 KASAN: use-after-free Read in ext4_find_extent
2023/09/22 15:16 android13-5.15-lts ea586874d2f9 0b6a67ac .config strace log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-android-5-15 KASAN: use-after-free Read in ext4_find_extent
2023/06/16 06:36 android13-5.15-lts 19c0ed55a470 f3921d4d .config strace log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-android-5-15 KASAN: use-after-free Read in ext4_find_extent
2023/04/01 06:28 android13-5.15-lts 7364b7abbafb f325deb0 .config strace log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-android-5-15 KASAN: use-after-free Read in ext4_find_extent
2023/03/19 02:20 android13-5.15-lts 5448b2fda85f 7939252e .config strace log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-android-5-15 KASAN: use-after-free Read in ext4_find_extent
2022/12/14 02:48 android13-5.15-lts 7048384c9872 f6511626 .config strace log report syz [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-android-5-15 KASAN: use-after-free Read in ext4_find_extent
2022/12/12 18:12 android13-5.15-lts 7048384c9872 67be1ae7 .config strace log report syz [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-android-5-15 KASAN: use-after-free Read in ext4_find_extent
2022/12/04 17:22 android13-5.15-lts 92f701cae0bc e080de16 .config strace log report syz [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-android-5-15 KASAN: use-after-free Read in ext4_find_extent
2022/12/26 07:49 android13-5.15-lts c73b4619ad86 9da18ae8 .config strace log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-android-5-15 KASAN: use-after-free Read in ext4_find_extent
2025/03/31 14:49 android13-5.15-lts 5e1b899f19c3 d3999433 .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-5-15 KASAN: use-after-free Read in ext4_find_extent
2023/06/17 10:21 android13-5.15-lts 36f4f6fb72d5 f3921d4d .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-5-15 KASAN: use-after-free Read in ext4_find_extent
* Struck through repros no longer work on HEAD.