================================================================== 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 ffff0000d0783800 by task bch-copygc/loop/8972 CPU: 1 UID: 0 PID: 8972 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 8972: 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 The buggy address belongs to the object at ffff0000d0783800 which belongs to the cache kmalloc-16 of size 16 The buggy address is located 0 bytes inside of freed 16-byte region [ffff0000d0783800, ffff0000d0783810) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x110783 flags: 0x5ffc00000000000(node=0|zone=2|lastcpupid=0x7ff) page_type: f5(slab) raw: 05ffc00000000000 ffff0000c0001640 dead000000000100 dead000000000122 raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff0000d0783700: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc ffff0000d0783780: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc >ffff0000d0783800: fb fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc ^ ffff0000d0783880: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc ffff0000d0783900: fa fb fc fc fa fb fc fc 00 00 fc fc fa fb fc fc ==================================================================