bcachefs (loop0): Detected missing backpointers in bucket 34, now have 1/128 with missing running recovery pass check_extents_to_backpointers (17), currently at resume_logged_ops (39) - rewinding ================================================================== BUG: KASAN: slab-use-after-free in generic_test_bit include/asm-generic/bitops/generic-non-atomic.h:128 [inline] BUG: KASAN: slab-use-after-free in bch2_bucket_bitmap_test fs/bcachefs/backpointers.h:194 [inline] BUG: KASAN: slab-use-after-free in bch2_bucket_is_movable fs/bcachefs/movinggc.c:78 [inline] BUG: KASAN: slab-use-after-free in bch2_copygc_get_buckets fs/bcachefs/movinggc.c:157 [inline] BUG: KASAN: slab-use-after-free in bch2_copygc+0xb34/0x3570 fs/bcachefs/movinggc.c:221 Read of size 8 at addr ffff0000cbdf5f20 by task bch-copygc/loop/7527 CPU: 0 UID: 0 PID: 7527 Comm: bch-copygc/loop Not tainted 6.17.0-rc1-syzkaller-g8f5ae30d69d7 #0 PREEMPT Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/30/2025 Call trace: show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:499 (C) __dump_stack+0x30/0x40 lib/dump_stack.c:94 dump_stack_lvl+0xd8/0x12c lib/dump_stack.c:120 print_address_description+0xa8/0x238 mm/kasan/report.c:378 print_report+0x68/0x84 mm/kasan/report.c:482 kasan_report+0xb0/0x110 mm/kasan/report.c:595 __asan_report_load8_noabort+0x20/0x2c mm/kasan/report_generic.c:381 generic_test_bit include/asm-generic/bitops/generic-non-atomic.h:128 [inline] bch2_bucket_bitmap_test fs/bcachefs/backpointers.h:194 [inline] bch2_bucket_is_movable fs/bcachefs/movinggc.c:78 [inline] bch2_copygc_get_buckets fs/bcachefs/movinggc.c:157 [inline] bch2_copygc+0xb34/0x3570 fs/bcachefs/movinggc.c:221 bch2_copygc_thread+0x898/0xd8c fs/bcachefs/movinggc.c:409 kthread+0x5fc/0x75c kernel/kthread.c:463 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:844 Allocated by task 7527: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x40/0x78 mm/kasan/common.c:68 kasan_save_alloc_info+0x44/0x54 mm/kasan/generic.c:562 poison_kmalloc_redzone mm/kasan/common.c:388 [inline] __kasan_kmalloc+0x9c/0xb4 mm/kasan/common.c:405 kasan_kmalloc include/linux/kasan.h:260 [inline] __do_kmalloc_node mm/slub.c:4365 [inline] __kvmalloc_node_noprof+0x38c/0x638 mm/slub.c:5052 kvmalloc_array_node_noprof include/linux/slab.h:1065 [inline] bch2_bucket_bitmap_set+0x160/0x1bc fs/bcachefs/backpointers.c:1351 check_bucket_backpointer_mismatch+0x1288/0x1860 fs/bcachefs/backpointers.c:964 check_bucket_backpointer_pos_mismatch fs/bcachefs/backpointers.c:1193 [inline] bch2_check_bucket_backpointer_mismatch+0x16c/0x3a0 fs/bcachefs/backpointers.c:1205 __bch2_move_data_phys+0x1144/0x144c fs/bcachefs/move.c:922 bch2_evacuate_bucket+0x220/0x34c fs/bcachefs/move.c:1082 bch2_copygc+0x2d80/0x3570 fs/bcachefs/movinggc.c:234 bch2_copygc_thread+0x898/0xd8c fs/bcachefs/movinggc.c:409 kthread+0x5fc/0x75c kernel/kthread.c:463 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:844 Freed by task 7499: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x40/0x78 mm/kasan/common.c:68 kasan_save_free_info+0x58/0x70 mm/kasan/generic.c:576 poison_slab_object mm/kasan/common.c:243 [inline] __kasan_slab_free+0x74/0x98 mm/kasan/common.c:275 kasan_slab_free include/linux/kasan.h:233 [inline] slab_free_hook mm/slub.c:2417 [inline] slab_free mm/slub.c:4680 [inline] kfree+0x17c/0x474 mm/slub.c:4879 kvfree+0x30/0x40 mm/slub.c:5095 bch2_bucket_bitmap_free fs/bcachefs/backpointers.c:1387 [inline] bch2_check_extents_to_backpointers+0x19b4/0x1c6c fs/bcachefs/backpointers.c:1168 bch2_run_recovery_pass fs/bcachefs/recovery_passes.c:484 [inline] __bch2_run_recovery_passes+0x2b8/0xd54 fs/bcachefs/recovery_passes.c:539 bch2_run_recovery_passes+0x174/0x1f4 fs/bcachefs/recovery_passes.c:610 bch2_fs_recovery+0x1c34/0x2fb4 fs/bcachefs/recovery.c:1016 bch2_fs_start+0x940/0xbec fs/bcachefs/super.c:1213 bch2_fs_get_tree+0x880/0x107c fs/bcachefs/fs.c:2488 vfs_get_tree+0x90/0x28c fs/super.c:1815 do_new_mount+0x278/0x7f4 fs/namespace.c:3805 path_mount+0x5b4/0xde0 fs/namespace.c:4120 do_mount fs/namespace.c:4133 [inline] __do_sys_mount fs/namespace.c:4344 [inline] __se_sys_mount fs/namespace.c:4321 [inline] __arm64_sys_mount+0x3e8/0x468 fs/namespace.c:4321 __invoke_syscall arch/arm64/kernel/syscall.c:35 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:49 el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:132 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:151 el0_svc+0x58/0x180 arch/arm64/kernel/entry-common.c:879 el0t_64_sync_handler+0x84/0x12c arch/arm64/kernel/entry-common.c:898 el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:596 The buggy address belongs to the object at ffff0000cbdf5f20 which belongs to the cache kmalloc-16 of size 16 The buggy address is located 0 bytes inside of freed 16-byte region [ffff0000cbdf5f20, ffff0000cbdf5f30) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10bdf5 flags: 0x5ffc00000000000(node=0|zone=2|lastcpupid=0x7ff) page_type: f5(slab) raw: 05ffc00000000000 ffff0000c0001640 fffffdffc3285540 dead000000000002 raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff0000cbdf5e00: 00 01 fc fc fa fb fc fc fa fb fc fc fa fb fc fc ffff0000cbdf5e80: fa fb fc fc 00 01 fc fc fa fb fc fc 00 01 fc fc >ffff0000cbdf5f00: 00 01 fc fc fa fb fc fc 00 01 fc fc 00 07 fc fc ^ ffff0000cbdf5f80: fa fb fc fc fa fb fc fc fa fb fc fc 00 04 fc fc ffff0000cbdf6000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ================================================================== bcachefs (loop0): Detected missing backpointers in bucket 34, now have 1/128 with missing bcachefs (loop0): u64s 13 type alloc_v4 0:25:0 len 0 ver 0: gen 0 oldest_gen 0 data_type journal journal_seq_nonempty 0 journal_seq_empty 0 need_discard 0 need_inc_gen 0 dirty_sectors 256 stripe_sectors 0 cached_sectors 0 stripe 0 stripe_redundancy 0 io_time[READ] 0 io_time[WRITE] 0 fragmentation 0 bp_start 8 incorrectly set at freespace:0:25:0 (free 0, genbits 0 should be 0), fixing