bcachefs (loop0): recovering from clean shutdown, journal seq 10 bcachefs (loop0): Doing compatible version upgrade from 1.7: mi_btree_bitmap to 1.25: extent_flags running recovery passes: check_allocations,check_extents_to_backpointers,check_inodes ================================================================== BUG: KASAN: use-after-free in poly1305_update include/crypto/poly1305.h:83 [inline] BUG: KASAN: use-after-free in bch2_checksum+0x209/0x490 fs/bcachefs/checksum.c:157 Read of size 8 at addr ffff88806b8a1790 by task syz-executor.0/6200 CPU: 0 UID: 0 PID: 6200 Comm: syz-executor.0 Not tainted 6.15.0-rc5-syzkaller-00207-g1a33418a69cc #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 check_region_inline mm/kasan/generic.c:-1 [inline] kasan_check_range+0x29a/0x2b0 mm/kasan/generic.c:189 __asan_memcpy+0x29/0x70 mm/kasan/shadow.c:105 poly1305_update include/crypto/poly1305.h:83 [inline] bch2_checksum+0x209/0x490 fs/bcachefs/checksum.c:157 bch2_btree_node_read_done+0x1003/0x5470 fs/bcachefs/btree_io.c:1133 btree_node_read_work+0x565/0xef0 fs/bcachefs/btree_io.c:1367 bch2_btree_node_read+0x2151/0x27a0 fs/bcachefs/btree_io.c:-1 __bch2_btree_root_read fs/bcachefs/btree_io.c:1801 [inline] bch2_btree_root_read+0x5e7/0x750 fs/bcachefs/btree_io.c:1823 read_btree_roots+0x2cb/0x800 fs/bcachefs/recovery.c:582 bch2_fs_recovery+0x2356/0x37b0 fs/bcachefs/recovery.c:929 bch2_fs_start+0x70b/0xae0 fs/bcachefs/super.c:1096 bch2_fs_get_tree+0xad7/0x13b0 fs/bcachefs/fs.c:2505 vfs_get_tree+0x8f/0x2b0 fs/super.c:1759 do_new_mount+0x24a/0xa40 fs/namespace.c:3884 do_mount fs/namespace.c:4224 [inline] __do_sys_mount fs/namespace.c:4435 [inline] __se_sys_mount+0x317/0x410 fs/namespace.c:4412 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:0x7f7174a7f3aa Code: d8 64 89 02 48 c7 c0 ff ff ff ff eb a6 e8 de 09 00 00 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f717573bef8 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 00007f717573bf80 RCX: 00007f7174a7f3aa RDX: 0000000020011a00 RSI: 0000000020011a40 RDI: 00007f717573bf40 RBP: 0000000020011a00 R08: 00007f717573bf80 R09: 0000000001200014 R10: 0000000001200014 R11: 0000000000000246 R12: 0000000020011a40 R13: 00007f717573bf40 R14: 00000000000119f9 R15: 0000000020000100 The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffffffffffffffff pfn:0x6b8a1 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000000 0000000000000000 00000000ffffffff 0000000000000000 raw: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as freed page last allocated via order 5, migratetype Reclaimable, gfp_mask 0x452cd0(GFP_KERNEL_ACCOUNT|__GFP_RECLAIMABLE|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP), pid 6200, tgid 6199 (syz-executor.0), ts 92543959837, free_ts 92702381594 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1d8/0x230 mm/page_alloc.c:1718 prep_new_page mm/page_alloc.c:1726 [inline] get_page_from_freelist+0x21c7/0x22a0 mm/page_alloc.c:3688 __alloc_frozen_pages_noprof+0x181/0x370 mm/page_alloc.c:4970 __alloc_pages_noprof+0xa/0x30 mm/page_alloc.c:5004 __alloc_pages_node_noprof include/linux/gfp.h:284 [inline] alloc_pages_node_noprof include/linux/gfp.h:311 [inline] ___kmalloc_large_node+0x85/0x200 mm/slub.c:4271 __kmalloc_large_node_noprof+0x18/0x90 mm/slub.c:4299 __do_kmalloc_node mm/slub.c:4315 [inline] __kvmalloc_node_noprof+0x74/0x5e0 mm/slub.c:5012 btree_node_data_alloc+0xd5/0x260 fs/bcachefs/btree_cache.c:156 __bch2_btree_node_mem_alloc+0x1ed/0x410 fs/bcachefs/btree_cache.c:201 bch2_fs_btree_cache_init+0x2c9/0x680 fs/bcachefs/btree_cache.c:656 bch2_fs_alloc fs/bcachefs/super.c:914 [inline] bch2_fs_open+0x235e/0x2820 fs/bcachefs/super.c:2210 bch2_fs_get_tree+0x45d/0x13b0 fs/bcachefs/fs.c:2489 vfs_get_tree+0x8f/0x2b0 fs/super.c:1759 do_new_mount+0x24a/0xa40 fs/namespace.c:3884 do_mount fs/namespace.c:4224 [inline] __do_sys_mount fs/namespace.c:4435 [inline] __se_sys_mount+0x317/0x410 fs/namespace.c:4412 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xf6/0x210 arch/x86/entry/syscall_64.c:94 page last free pid 6200 tgid 6199 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1262 [inline] __free_pages_ok+0x910/0xac0 mm/page_alloc.c:1438 __folio_put+0x21b/0x2c0 mm/swap.c:112 folio_put include/linux/mm.h:1580 [inline] free_large_kmalloc+0x145/0x200 mm/slub.c:4767 btree_bounce_free fs/bcachefs/btree_io.c:113 [inline] bch2_btree_node_read_done+0x3450/0x5470 fs/bcachefs/btree_io.c:1246 btree_node_read_work+0x565/0xef0 fs/bcachefs/btree_io.c:1367 bch2_btree_node_read+0x2151/0x27a0 fs/bcachefs/btree_io.c:-1 __bch2_btree_root_read fs/bcachefs/btree_io.c:1801 [inline] bch2_btree_root_read+0x5e7/0x750 fs/bcachefs/btree_io.c:1823 read_btree_roots+0x2cb/0x800 fs/bcachefs/recovery.c:582 bch2_fs_recovery+0x2356/0x37b0 fs/bcachefs/recovery.c:929 bch2_fs_start+0x70b/0xae0 fs/bcachefs/super.c:1096 bch2_fs_get_tree+0xad7/0x13b0 fs/bcachefs/fs.c:2505 vfs_get_tree+0x8f/0x2b0 fs/super.c:1759 do_new_mount+0x24a/0xa40 fs/namespace.c:3884 do_mount fs/namespace.c:4224 [inline] __do_sys_mount fs/namespace.c:4435 [inline] __se_sys_mount+0x317/0x410 fs/namespace.c:4412 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: ffff88806b8a1680: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88806b8a1700: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff88806b8a1780: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff88806b8a1800: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88806b8a1880: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================