EXT4-fs: Ignoring removed orlov option EXT4-fs (loop0): stripe (1570) 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+0xae6/0xcc0 fs/ext4/extents.c:955 Read of size 4 at addr ffff88803e7c5018 by task syz.0.618/12053 CPU: 1 UID: 0 PID: 12053 Comm: syz.0.618 Not tainted 6.15.0-rc7-syzkaller #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025 Call Trace: dump_stack_lvl+0x189/0x250 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:408 [inline] print_report+0xb4/0x290 mm/kasan/report.c:521 kasan_report+0x118/0x150 mm/kasan/report.c:634 ext4_ext_binsearch fs/ext4/extents.c:840 [inline] ext4_find_extent+0xae6/0xcc0 fs/ext4/extents.c:955 ext4_ext_map_blocks+0x26f/0x67c0 fs/ext4/extents.c:4205 ext4_map_query_blocks+0x99/0x2a0 fs/ext4/inode.c:472 ext4_map_blocks+0x38e/0x1740 fs/ext4/inode.c:670 _ext4_get_block+0x200/0x4c0 fs/ext4/inode.c:785 ext4_get_block_unwritten+0x2e/0x100 fs/ext4/inode.c:818 ext4_block_write_begin+0x546/0x1290 fs/ext4/inode.c:1067 ext4_write_begin+0x6f6/0x12c0 fs/ext4/ext4_jbd2.h:-1 ext4_da_write_begin+0x33a/0xa60 fs/ext4/inode.c:2932 generic_perform_write+0x2c4/0x910 mm/filemap.c:4103 ext4_buffered_write_iter+0xce/0x3a0 fs/ext4/file.c:299 ext4_file_write_iter+0x298/0x1bc0 fs/ext4/file.c:-1 new_sync_write fs/read_write.c:591 [inline] vfs_write+0x54b/0xa90 fs/read_write.c:684 ksys_pwrite64 fs/read_write.c:791 [inline] __do_sys_pwrite64 fs/read_write.c:799 [inline] __se_sys_pwrite64 fs/read_write.c:796 [inline] __x64_sys_pwrite64+0x193/0x220 fs/read_write.c:796 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xf6/0x210 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f913a78e969 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 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 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f913b667038 EFLAGS: 00000246 ORIG_RAX: 0000000000000012 RAX: ffffffffffffffda RBX: 00007f913a9b5fa0 RCX: 00007f913a78e969 RDX: 000000000000fdef RSI: 0000200000000140 RDI: 0000000000000004 RBP: 00007f913a810ab1 R08: 0000000000000000 R09: 0000000000000000 R10: 000000000000fecc R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f913a9b5fa0 R15: 00007ffe40a21ec8 The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x3e7c5 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000000 dead000000000100 dead000000000122 0000000000000000 raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as freed page last allocated via order 0, migratetype Unmovable, gfp_mask 0x2cc2(GFP_KERNEL|__GFP_HIGHMEM|__GFP_NOWARN), pid 11989, tgid 11988 (syz.5.615), ts 492452061831, free_ts 493127912344 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1d8/0x230 mm/page_alloc.c:1714 prep_new_page mm/page_alloc.c:1722 [inline] get_page_from_freelist+0x21c7/0x22a0 mm/page_alloc.c:3684 __alloc_frozen_pages_noprof+0x181/0x370 mm/page_alloc.c:4966 alloc_pages_mpol+0x232/0x4a0 mm/mempolicy.c:2301 alloc_frozen_pages_noprof mm/mempolicy.c:2372 [inline] alloc_pages_noprof+0xa9/0x190 mm/mempolicy.c:2392 vm_area_alloc_pages mm/vmalloc.c:3592 [inline] __vmalloc_area_node mm/vmalloc.c:3670 [inline] __vmalloc_node_range_noprof+0x8fe/0x12c0 mm/vmalloc.c:3845 __kvmalloc_node_noprof+0x3a0/0x5e0 mm/slub.c:5034 __bch2_darray_resize_noprof+0xd7/0x290 fs/bcachefs/darray.c:24 bch2_fs_btree_write_buffer_init+0x26b/0x2f0 fs/bcachefs/btree_write_buffer.c:880 bch2_fs_alloc fs/bcachefs/super.c:919 [inline] bch2_fs_open+0x2438/0x2820 fs/bcachefs/super.c:2210 bch2_fs_get_tree+0x45d/0x13b0 fs/bcachefs/fs.c:2491 vfs_get_tree+0x92/0x2b0 fs/super.c:1759 do_new_mount+0x24a/0xa40 fs/namespace.c:3881 do_mount fs/namespace.c:4221 [inline] __do_sys_mount fs/namespace.c:4432 [inline] __se_sys_mount+0x317/0x410 fs/namespace.c:4409 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xf6/0x210 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f page last free pid 11989 tgid 11988 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1258 [inline] __free_frozen_pages+0xb05/0xcd0 mm/page_alloc.c:2721 vfree+0x1a6/0x330 mm/vmalloc.c:3384 bch2_fs_btree_write_buffer_exit+0x1ac/0x1e0 fs/bcachefs/btree_write_buffer.c:866 __bch2_fs_free fs/bcachefs/super.c:574 [inline] bch2_fs_release+0x313/0x7f0 fs/bcachefs/super.c:618 kobject_cleanup lib/kobject.c:689 [inline] kobject_release lib/kobject.c:720 [inline] kref_put include/linux/kref.h:65 [inline] kobject_put+0x22b/0x480 lib/kobject.c:737 bch2_fs_alloc fs/bcachefs/super.c:981 [inline] bch2_fs_open+0x1a7e/0x2820 fs/bcachefs/super.c:2210 bch2_fs_get_tree+0x45d/0x13b0 fs/bcachefs/fs.c:2491 vfs_get_tree+0x92/0x2b0 fs/super.c:1759 do_new_mount+0x24a/0xa40 fs/namespace.c:3881 do_mount fs/namespace.c:4221 [inline] __do_sys_mount fs/namespace.c:4432 [inline] __se_sys_mount+0x317/0x410 fs/namespace.c:4409 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xf6/0x210 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff88803e7c4f00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88803e7c4f80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff88803e7c5000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff88803e7c5080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88803e7c5100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================