loop9: detected capacity change from 0 to 32768 ================================================================== BUG: KASAN: use-after-free in ciCompare fs/jfs/jfs_dtree.c:3428 [inline] BUG: KASAN: use-after-free in dtSearch+0x16b4/0x21b0 fs/jfs/jfs_dtree.c:645 Read of size 1 at addr ffff88806e1204a4 by task syz.9.1073/16275 CPU: 1 UID: 0 PID: 16275 Comm: syz.9.1073 Tainted: G W 6.17.0-rc1-syzkaller-00224-g8d561baae505 #0 PREEMPT_{RT,(full)} Tainted: [W]=WARN Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2025 Call Trace: dump_stack_lvl+0x189/0x250 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0xca/0x240 mm/kasan/report.c:482 kasan_report+0x118/0x150 mm/kasan/report.c:595 ciCompare fs/jfs/jfs_dtree.c:3428 [inline] dtSearch+0x16b4/0x21b0 fs/jfs/jfs_dtree.c:645 jfs_lookup+0x155/0x380 fs/jfs/namei.c:1461 lookup_open fs/namei.c:3686 [inline] open_last_lookups fs/namei.c:3807 [inline] path_openat+0x110a/0x3840 fs/namei.c:4043 do_filp_open+0x1fa/0x410 fs/namei.c:4073 do_sys_openat2+0x121/0x1c0 fs/open.c:1435 do_sys_open fs/open.c:1450 [inline] __do_sys_openat fs/open.c:1466 [inline] __se_sys_openat fs/open.c:1461 [inline] __x64_sys_openat+0x138/0x170 fs/open.c:1461 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f675ab6ebe9 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:00007f6758dd6038 EFLAGS: 00000246 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 00007f675ad95fa0 RCX: 00007f675ab6ebe9 RDX: 0000000000040942 RSI: 0000200000000200 RDI: ffffffffffffff9c RBP: 00007f675abf1e19 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f675ad96038 R14: 00007f675ad95fa0 R15: 00007fff0e8383b8 The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff88806e123b80 pfn:0x6e120 flags: 0x80000000000000(node=0|zone=1) raw: 0080000000000000 ffffea0001b84908 ffffea0001b8a908 0000000000000000 raw: ffff88806e123b80 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as freed page last allocated via order 2, migratetype Reclaimable, gfp_mask 0x4428d0(GFP_NOWAIT|__GFP_RECLAIMABLE|__GFP_IO|__GFP_FS|__GFP_COMP|__GFP_ACCOUNT), pid 15615, tgid 15614 (syz.9.992), ts 694809845731, free_ts 699396140795 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x240/0x2a0 mm/page_alloc.c:1851 prep_new_page mm/page_alloc.c:1859 [inline] get_page_from_freelist+0x2119/0x21b0 mm/page_alloc.c:3858 __alloc_frozen_pages_noprof+0x181/0x370 mm/page_alloc.c:5148 alloc_pages_mpol+0xd1/0x380 mm/mempolicy.c:2416 ___kmalloc_large_node+0x5f/0x1b0 mm/slub.c:4306 __kmalloc_large_node_noprof+0x18/0x90 mm/slub.c:4337 __do_kmalloc_node mm/slub.c:4353 [inline] __kvmalloc_node_noprof+0x6f/0x550 mm/slub.c:5052 btree_node_data_alloc+0xdc/0x270 fs/bcachefs/btree_cache.c:151 __bch2_btree_node_mem_alloc+0x1dc/0x2e0 fs/bcachefs/btree_cache.c:193 bch2_fs_btree_cache_init+0x314/0x880 fs/bcachefs/btree_cache.c:653 bch2_fs_alloc fs/bcachefs/super.c:998 [inline] bch2_fs_open+0x1da6/0x26e0 fs/bcachefs/super.c:2433 bch2_fs_get_tree+0x44f/0x1520 fs/bcachefs/fs.c:2472 vfs_get_tree+0x8f/0x2b0 fs/super.c:1815 do_new_mount+0x2a2/0x9e0 fs/namespace.c:3805 do_mount fs/namespace.c:4133 [inline] __do_sys_mount fs/namespace.c:4344 [inline] __se_sys_mount+0x317/0x410 fs/namespace.c:4321 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94 page last free pid 14572 tgid 14572 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1395 [inline] __free_frozen_pages+0xb59/0xce0 mm/page_alloc.c:2895 free_large_kmalloc+0x13a/0x1f0 mm/slub.c:4805 __btree_node_data_free+0x2bb/0x3a0 fs/bcachefs/btree_cache.c:107 btree_node_data_free+0x13f/0x340 fs/bcachefs/btree_cache.c:122 bch2_fs_btree_cache_exit+0x9c1/0x13c0 fs/bcachefs/btree_cache.c:609 __bch2_fs_free fs/bcachefs/super.c:619 [inline] bch2_fs_release+0x2bb/0x830 fs/bcachefs/super.c:667 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 deactivate_locked_super+0xbc/0x130 fs/super.c:474 cleanup_mnt+0x425/0x4c0 fs/namespace.c:1378 task_work_run+0x1d1/0x260 kernel/task_work.c:227 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline] exit_to_user_mode_loop+0xec/0x110 kernel/entry/common.c:43 exit_to_user_mode_prepare include/linux/irq-entry-common.h:225 [inline] syscall_exit_to_user_mode_work include/linux/entry-common.h:175 [inline] syscall_exit_to_user_mode include/linux/entry-common.h:210 [inline] do_syscall_64+0x2bd/0x3b0 arch/x86/entry/syscall_64.c:100 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff88806e120380: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88806e120400: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff88806e120480: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff88806e120500: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88806e120580: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================