loop0: detected capacity change from 0 to 1024 ======================================================= WARNING: The mand mount option has been deprecated and and is ignored by this kernel. Remove the mand option from the mount to silence this warning. ======================================================= EXT4-fs: Ignoring removed oldalloc option EXT4-fs: Ignoring removed orlov option EXT4-fs (loop0): stripe (2) is not aligned with cluster size (16), stripe is disabled EXT4-fs (loop0): mounted filesystem 00000000-0000-0000-0000-000000000000 r/w without journal. Quota mode: writeback. ================================================================== BUG: KASAN: use-after-free in ext4_ext_binsearch fs/ext4/extents.c:840 [inline] BUG: KASAN: use-after-free in ext4_find_extent+0xaea/0xcc0 fs/ext4/extents.c:956 Read of size 4 at addr ffff88801fdefdfc by task syz.0.0/5329 CPU: 0 UID: 0 PID: 5329 Comm: syz.0.0 Not tainted syzkaller #0 PREEMPT(full) Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 Call Trace: dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0xba/0x230 mm/kasan/report.c:482 kasan_report+0x117/0x150 mm/kasan/report.c:595 ext4_ext_binsearch fs/ext4/extents.c:840 [inline] ext4_find_extent+0xaea/0xcc0 fs/ext4/extents.c:956 ext4_ext_map_blocks+0x283/0x58b0 fs/ext4/extents.c:4261 ext4_map_create_blocks+0x11d/0x540 fs/ext4/inode.c:616 ext4_map_blocks+0x7cd/0x11d0 fs/ext4/inode.c:809 mpage_map_one_extent fs/ext4/inode.c:2373 [inline] mpage_map_and_submit_extent fs/ext4/inode.c:2467 [inline] ext4_do_writepages+0x22c0/0x46e0 fs/ext4/inode.c:2925 ext4_writepages+0x241/0x3b0 fs/ext4/inode.c:3019 do_writepages+0x32e/0x550 mm/page-writeback.c:2554 filemap_writeback mm/filemap.c:387 [inline] filemap_fdatawrite_range mm/filemap.c:412 [inline] filemap_write_and_wait_range+0x335/0x3f0 mm/filemap.c:684 filemap_write_and_wait include/linux/pagemap.h:65 [inline] ext4_bmap+0x1ce/0x260 fs/ext4/inode.c:3365 bmap+0xac/0xe0 fs/inode.c:2052 ioctl_fibmap fs/ioctl.c:76 [inline] file_ioctl+0x4ac/0x860 fs/ioctl.c:326 do_vfs_ioctl+0xc26/0x1530 fs/ioctl.c:576 __do_sys_ioctl fs/ioctl.c:595 [inline] __se_sys_ioctl+0x82/0x170 fs/ioctl.c:583 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x14d/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f84b519c799 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:00007f84b6001fe8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007f84b5415fa0 RCX: 00007f84b519c799 RDX: 0000200000000080 RSI: 0000000000000001 RDI: 0000000000000005 RBP: 00007f84b5232bd9 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f84b5416038 R14: 00007f84b5415fa0 R15: 00007ffff13a81a8 The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x345 pfn:0x1fdef flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000000 dead000000000100 dead000000000122 0000000000000000 raw: 0000000000000345 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 0x140cca(GFP_HIGHUSER_MOVABLE|__GFP_COMP), pid 5292, tgid 5292 (syz-executor), ts 90596269078, free_ts 104855619426 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x231/0x280 mm/page_alloc.c:1889 prep_new_page mm/page_alloc.c:1897 [inline] get_page_from_freelist+0x24dc/0x2580 mm/page_alloc.c:3962 __alloc_frozen_pages_noprof+0x18d/0x380 mm/page_alloc.c:5250 alloc_pages_mpol+0x232/0x4a0 mm/mempolicy.c:2484 folio_alloc_mpol_noprof mm/mempolicy.c:2503 [inline] vma_alloc_folio_noprof+0xea/0x210 mm/mempolicy.c:2538 folio_prealloc mm/memory.c:-1 [inline] do_cow_fault mm/memory.c:5822 [inline] do_fault mm/memory.c:5934 [inline] do_pte_missing+0x4ea/0x3750 mm/memory.c:4477 handle_pte_fault mm/memory.c:6316 [inline] __handle_mm_fault mm/memory.c:6454 [inline] handle_mm_fault+0x1bec/0x3310 mm/memory.c:6623 do_user_addr_fault+0xa73/0x1340 arch/x86/mm/fault.c:1334 handle_page_fault arch/x86/mm/fault.c:1474 [inline] exc_page_fault+0x6a/0xc0 arch/x86/mm/fault.c:1527 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:618 page last free pid 76 tgid 76 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] __free_pages_prepare mm/page_alloc.c:1433 [inline] free_unref_folios+0xed5/0x16d0 mm/page_alloc.c:3040 shrink_folio_list+0x2a0f/0x5290 mm/vmscan.c:1541 evict_folios+0x4795/0x5880 mm/vmscan.c:4718 try_to_shrink_lruvec+0xb62/0xfa0 mm/vmscan.c:4881 shrink_one+0x25c/0x710 mm/vmscan.c:4926 shrink_many mm/vmscan.c:4989 [inline] lru_gen_shrink_node mm/vmscan.c:5067 [inline] shrink_node+0x3197/0x3a90 mm/vmscan.c:6047 kswapd_shrink_node mm/vmscan.c:6894 [inline] balance_pgdat mm/vmscan.c:7070 [inline] kswapd+0x1742/0x2e10 mm/vmscan.c:7343 kthread+0x388/0x470 kernel/kthread.c:436 ret_from_fork+0x51e/0xb90 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 Memory state around the buggy address: ffff88801fdefc80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88801fdefd00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff88801fdefd80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff88801fdefe00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88801fdefe80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================