syzbot


KASAN: use-after-free Read in ext4_find_extent

Status: upstream: reported C repro on 2022/12/26 07:59
Subsystems: ext4
[Documentation on labels]
Reported-by: syzbot+212b805f83aa4e82c10a@syzkaller.appspotmail.com
First crash: 720d, last: 5h53m
Cause bisection: failed (error log, bisect log)
  
Fix bisection the fix commit could be any of (bisect log):
  003c389455eb Merge 5.10.160 into android12-5.10-lts
  bf760358eac3 Merge branch 'android12-5.10' into android12-5.10-lts
  
Similar bugs (8)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
android-6-1 KASAN: use-after-free Read in ext4_find_extent missing-backport origin:lts C error 3 27d 524d 0/2 upstream: reported C repro on 2023/06/18 03:55
linux-5.15 KASAN: use-after-free Read in ext4_find_extent origin:lts-only C inconclusive 5 26d 493d 0/3 upstream: reported C repro on 2023/07/19 14:49
upstream KASAN: use-after-free Read in ext4_find_extent ext4 2 1130d 1191d 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 208d 432d 0/3 upstream: reported C repro on 2023/09/19 00:11
android-5-15 KASAN: use-after-free Read in ext4_find_extent ext4 origin:lts C error 9 13d 698d 0/2 upstream: reported C repro on 2022/12/26 07:59
upstream KASAN: use-after-free Read in ext4_find_extent (2) ext4 C error 2 569d 693d 22/28 fixed on 2023/06/08 14:41
upstream KASAN: use-after-free Read in ext4_find_extent (3) prio:low ext4 C error done 31 333d 515d 25/28 fixed on 2024/01/30 23:26
android-54 KASAN: slab-out-of-bounds Read in ext4_find_extent ext4 C 1 512d 698d 0/2 auto-obsoleted due to no activity on 2023/10/08 03:20
Last patch testing requests (10)
Created Duration User Patch Repo Result
2024/11/07 13:47 6m retest repro android13-5.10-lts report log
2024/10/24 12:26 13m retest repro android13-5.10-lts report log
2024/09/16 16:40 16m retest repro android13-5.10-lts report log
2024/09/16 16:40 8m retest repro android13-5.10-lts report log
2024/09/16 16:40 16m retest repro android13-5.10-lts report log
2024/08/19 18:56 5m retest repro android13-5.10-lts report log
2024/08/05 18:46 7m retest repro android13-5.10-lts report log
2024/06/24 21:24 5m retest repro android13-5.10-lts report log
2024/06/24 21:24 5m retest repro android13-5.10-lts report log
2024/06/10 18:42 16m retest repro android13-5.10-lts report log

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in ext4_ext_binsearch fs/ext4/extents.c:826 [inline]
BUG: KASAN: use-after-free in ext4_find_extent+0xba3/0xd80 fs/ext4/extents.c:945
Read of size 4 at addr ffff88811dc4302c by task kworker/u4:1/9

CPU: 1 PID: 9 Comm: kworker/u4:1 Not tainted 5.10.161-syzkaller-00019-g416c4356f372 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/02/2023
Workqueue: writeback wb_workfn (flush-7:0)
Call Trace:
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack_lvl+0x1e2/0x24b lib/dump_stack.c:118
 print_address_description+0x81/0x3c0 mm/kasan/report.c:233
 __kasan_report mm/kasan/report.c:419 [inline]
 kasan_report+0x1a4/0x1f0 mm/kasan/report.c:436
 __asan_report_load4_noabort+0x14/0x20 mm/kasan/report_generic.c:308
 ext4_ext_binsearch fs/ext4/extents.c:826 [inline]
 ext4_find_extent+0xba3/0xd80 fs/ext4/extents.c:945
 ext4_ext_map_blocks+0x219/0x3a30 fs/ext4/extents.c:4097
 ext4_map_blocks+0xa93/0x1ee0 fs/ext4/inode.c:638
 mpage_map_one_extent+0x1bd/0x680 fs/ext4/inode.c:2441
 mpage_map_and_submit_extent fs/ext4/inode.c:2494 [inline]
 ext4_writepages+0x15e9/0x3710 fs/ext4/inode.c:2862
 do_writepages+0x13a/0x280 mm/page-writeback.c:2358
 __writeback_single_inode+0xb8/0x6e0 fs/fs-writeback.c:1467
 writeback_sb_inodes+0x999/0x1700 fs/fs-writeback.c:1730
 wb_writeback+0x42f/0xc20 fs/fs-writeback.c:1905
 wb_do_writeback+0x222/0xbd0 fs/fs-writeback.c:2050
 wb_workfn+0xf8/0x3f0 fs/fs-writeback.c:2091
 process_one_work+0x726/0xc10 kernel/workqueue.c:2296
 worker_thread+0xb27/0x1550 kernel/workqueue.c:2442
 kthread+0x349/0x3d0 kernel/kthread.c:313
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:299

The buggy address belongs to the page:
page:ffffea00047710c0 refcount:0 mapcount:0 mapping:0000000000000000 index:0x1 pfn:0x11dc43
flags: 0x8000000000000000()
raw: 8000000000000000 dead000000000100 dead000000000122 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 0x3100dca(GFP_HIGHUSER_MOVABLE|__GFP_ZERO|0x2000000), pid 297, ts 12920941513, free_ts 12928566451
 set_page_owner include/linux/page_owner.h:35 [inline]
 post_alloc_hook mm/page_alloc.c:2386 [inline]
 prep_new_page mm/page_alloc.c:2392 [inline]
 get_page_from_freelist+0x755/0x810 mm/page_alloc.c:4073
 __alloc_pages_nodemask+0x3b6/0x890 mm/page_alloc.c:5160
 __alloc_pages include/linux/gfp.h:529 [inline]
 __alloc_pages_node include/linux/gfp.h:542 [inline]
 alloc_pages_node include/linux/gfp.h:556 [inline]
 alloc_pages include/linux/gfp.h:575 [inline]
 do_anonymous_page+0x307/0x1050 mm/memory.c:3922
 handle_pte_fault+0x4cd/0x9d0 mm/memory.c:4735
 __handle_mm_fault mm/memory.c:4895 [inline]
 handle_mm_fault+0xf22/0x19f0 mm/memory.c:5259
 do_user_addr_fault+0x67e/0xce0 arch/x86/mm/fault.c:1396
 handle_page_fault arch/x86/mm/fault.c:1462 [inline]
 exc_page_fault+0x71/0x1b0 arch/x86/mm/fault.c:1518
 asm_exc_page_fault+0x1e/0x30 arch/x86/include/asm/idtentry.h:571
page last free stack trace:
 reset_page_owner include/linux/page_owner.h:28 [inline]
 free_pages_prepare mm/page_alloc.c:1332 [inline]
 free_pcp_prepare+0x18c/0x1c0 mm/page_alloc.c:1406
 free_unref_page_prepare mm/page_alloc.c:3293 [inline]
 free_unref_page_list+0x11d/0x660 mm/page_alloc.c:3367
 release_pages+0xc24/0xc60 mm/swap.c:1082
 free_pages_and_swap_cache+0x97/0xb0 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+0x8a0/0xa80 mm/mmu_gather.c:247
 tlb_finish_mmu+0xd2/0x1f0 mm/mmu_gather.c:326
 unmap_region+0x346/0x390 mm/mmap.c:2798
 __do_munmap+0x696/0x8c0 mm/mmap.c:3027
 __vm_munmap mm/mmap.c:3050 [inline]
 __do_sys_munmap mm/mmap.c:3076 [inline]
 __se_sys_munmap+0x121/0x1b0 mm/mmap.c:3072
 __x64_sys_munmap+0x5b/0x70 mm/mmap.c:3072
 do_syscall_64+0x34/0x70 arch/x86/entry/common.c:46
 entry_SYSCALL_64_after_hwframe+0x61/0xc6

Memory state around the buggy address:
 ffff88811dc42f00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff88811dc42f80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff88811dc43000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
                                  ^
 ffff88811dc43080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff88811dc43100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
==================================================================
------------[ cut here ]------------
kernel BUG at fs/ext4/inode.c:2453!
invalid opcode: 0000 [#1] PREEMPT SMP KASAN
CPU: 1 PID: 9 Comm: kworker/u4:1 Tainted: G    B             5.10.161-syzkaller-00019-g416c4356f372 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/02/2023
Workqueue: writeback wb_workfn (flush-7:0)
RIP: 0010:mpage_map_one_extent+0x5df/0x680 fs/ext4/inode.c:2453
Code: f6 48 0f a3 05 62 7b c1 04 0f 92 c3 40 0f 92 c6 31 ff e8 b4 a3 8f ff 84 db 75 11 e8 9b a0 8f ff e9 74 fa ff ff e8 91 a0 8f ff <0f> 0b 65 ff 05 64 ec 24 7e 48 c7 c0 68 cf 9c 86 48 c1 e8 03 42 80
RSP: 0018:ffffc90000097068 EFLAGS: 00010293
RAX: ffffffff81dd811f RBX: 0000000000000000 RCX: ffff88810023bb40
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: ffffc900000970b0 R08: ffffffff81dd7fa8 R09: ffffed1021d64843
R10: ffffed1021d64843 R11: 1ffff11021d64842 R12: 0000000000000000
R13: ffffc900000973b4 R14: 0000000000000000 R15: 1ffff92000012e77
FS:  0000000000000000(0000) GS:ffff8881f7100000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000055f35449cbb8 CR3: 000000010ca6e000 CR4: 00000000003506a0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 mpage_map_and_submit_extent fs/ext4/inode.c:2494 [inline]
 ext4_writepages+0x15e9/0x3710 fs/ext4/inode.c:2862
 do_writepages+0x13a/0x280 mm/page-writeback.c:2358
 __writeback_single_inode+0xb8/0x6e0 fs/fs-writeback.c:1467
 writeback_sb_inodes+0x999/0x1700 fs/fs-writeback.c:1730
 wb_writeback+0x42f/0xc20 fs/fs-writeback.c:1905
 wb_do_writeback+0x222/0xbd0 fs/fs-writeback.c:2050
 wb_workfn+0xf8/0x3f0 fs/fs-writeback.c:2091
 process_one_work+0x726/0xc10 kernel/workqueue.c:2296
 worker_thread+0xb27/0x1550 kernel/workqueue.c:2442
 kthread+0x349/0x3d0 kernel/kthread.c:313
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:299
Modules linked in:
---[ end trace 483450afbef76f28 ]---
RIP: 0010:mpage_map_one_extent+0x5df/0x680 fs/ext4/inode.c:2453
Code: f6 48 0f a3 05 62 7b c1 04 0f 92 c3 40 0f 92 c6 31 ff e8 b4 a3 8f ff 84 db 75 11 e8 9b a0 8f ff e9 74 fa ff ff e8 91 a0 8f ff <0f> 0b 65 ff 05 64 ec 24 7e 48 c7 c0 68 cf 9c 86 48 c1 e8 03 42 80
RSP: 0018:ffffc90000097068 EFLAGS: 00010293
RAX: ffffffff81dd811f RBX: 0000000000000000 RCX: ffff88810023bb40
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: ffffc900000970b0 R08: ffffffff81dd7fa8 R09: ffffed1021d64843
R10: ffffed1021d64843 R11: 1ffff11021d64842 R12: 0000000000000000
R13: ffffc900000973b4 R14: 0000000000000000 R15: 1ffff92000012e77
FS:  0000000000000000(0000) GS:ffff8881f7000000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000055e49407e058 CR3: 000000010c555000 CR4: 00000000003506b0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400

Crashes (25):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/04/01 05:47 android12-5.10-lts 416c4356f372 f325deb0 .config strace log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-android-5-10 KASAN: use-after-free Read in ext4_find_extent
2023/03/19 01:42 android12-5.10-lts 416c4356f372 7939252e .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-android-5-10 KASAN: use-after-free Read in ext4_find_extent
2022/12/21 09:05 android12-5.10-lts 003c389455eb d3e76707 .config strace log report syz [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-android-5-10 KASAN: use-after-free Read in ext4_find_extent
2022/12/12 16:05 android12-5.10-lts f3226d86f8ce 67be1ae7 .config strace log report syz [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-android-5-10 KASAN: use-after-free Read in ext4_find_extent
2022/12/04 17:23 android12-5.10-lts 25af5a11f1da e080de16 .config strace log report syz [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-android-5-10 KASAN: use-after-free Read in ext4_find_extent
2022/12/26 07:48 android12-5.10-lts 003c389455eb 9da18ae8 .config strace log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-android-5-10 KASAN: use-after-free Read in ext4_find_extent
2024/11/23 21:22 android13-5.10-lts b14940b90491 68da6d95 .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-5-10 KASAN: use-after-free Read in ext4_find_extent
2024/10/08 01:40 android13-5.10-lts e5e5644ea27f d7906eff .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-5-10 KASAN: use-after-free Read in ext4_find_extent
2024/10/05 09:57 android13-5.10-lts e5e5644ea27f d7906eff .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-5-10 KASAN: use-after-free Read in ext4_find_extent
2024/09/02 16:32 android13-5.10-lts 1c5354a314ea 1eda0d14 .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-5-10 KASAN: use-after-free Read in ext4_find_extent
2023/09/10 01:17 android13-5.10-lts a27512601c2d 6654cf89 .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-5-10 KASAN: use-after-free Read in ext4_find_extent
2023/09/09 20:25 android13-5.10-lts a27512601c2d 6654cf89 .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-5-10 KASAN: use-after-free Read in ext4_find_extent
2023/06/12 10:23 android13-5.10-lts 43c801dc3325 49519f06 .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-5-10 KASAN: use-after-free Read in ext4_find_extent
2023/05/22 05:46 android13-5.10-lts 43c801dc3325 4bce1a3e .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-5-10 KASAN: use-after-free Read in ext4_find_extent
2023/04/26 09:25 android12-5.10-lts 416c4356f372 65320f8e .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-5-10 KASAN: use-after-free Read in ext4_find_extent
2023/04/06 18:08 android12-5.10-lts 416c4356f372 08707520 .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-5-10 KASAN: use-after-free Read in ext4_find_extent
2023/04/04 06:55 android12-5.10-lts 416c4356f372 41147e3e .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-5-10 KASAN: use-after-free Read in ext4_find_extent
2023/03/28 08:43 android12-5.10-lts 416c4356f372 47f3aaf1 .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-5-10 KASAN: use-after-free Read in ext4_find_extent
2023/03/27 18:47 android12-5.10-lts 416c4356f372 f8f96aa9 .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-5-10 KASAN: use-after-free Read in ext4_find_extent
2023/03/16 12:53 android12-5.10-lts 416c4356f372 18b58603 .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-5-10 KASAN: use-after-free Read in ext4_find_extent
2023/03/14 03:54 android12-5.10-lts 416c4356f372 026e2200 .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-5-10 KASAN: use-after-free Read in ext4_find_extent
2023/03/11 04:18 android12-5.10-lts 416c4356f372 5205ef30 .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-5-10 KASAN: use-after-free Read in ext4_find_extent
2023/02/24 17:51 android12-5.10-lts 416c4356f372 ee50e71c .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-5-10 KASAN: use-after-free Read in ext4_find_extent
2022/12/14 02:10 android12-5.10-lts 202ee063496e f6511626 .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-5-10 KASAN: use-after-free Read in ext4_find_extent
2023/03/03 01:51 android12-5.10-lts 416c4356f372 f8902b57 .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-5-10 KASAN: slab-out-of-bounds Read in ext4_find_extent
* Struck through repros no longer work on HEAD.