loop0: detected capacity change from 0 to 32768 bcachefs (loop0): starting version 1.7: mi_btree_bitmap opts=metadata_checksum=none,data_checksum=none,compression=lz4,nojournal_transaction_names bcachefs (loop0): recovering from clean shutdown, journal seq 13 bcachefs (loop0): Version upgrade required: Version upgrade from 0.19: freespace to 1.7: mi_btree_bitmap incomplete Doing incompatible version upgrade from 0.19: freespace to 1.13: inode_has_child_snapshots running recovery passes: check_allocations,check_alloc_info,check_lrus,check_btree_backpointers,check_backpointers_to_extents,check_extents_to_backpointers,check_alloc_to_lru_refs,bucket_gens_init,check_snapshot_trees,check_snapshots,check_subvols,check_subvol_children,delete_dead_snapshots,check_inodes,check_extents,check_indirect_extents,check_dirents,check_xattrs,check_root,check_unreachable_inodes,check_subvolume_structure,check_directory_structure,check_nlinks,set_fs_needs_rebalance ================================================================== BUG: KASAN: use-after-free in poly1305_update_arch+0x259/0x7d0 arch/x86/crypto/poly1305_glue.c:198 Read of size 8 at addr ffff888051a20090 by task syz.0.0/5328 CPU: 0 UID: 0 PID: 5328 Comm: syz.0.0 Not tainted 6.12.0-rc5-syzkaller-00047-g4236f913808c #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:377 [inline] print_report+0x169/0x550 mm/kasan/report.c:488 kasan_report+0x143/0x180 mm/kasan/report.c:601 kasan_check_range+0x282/0x290 mm/kasan/generic.c:189 __asan_memcpy+0x29/0x70 mm/kasan/shadow.c:105 poly1305_update_arch+0x259/0x7d0 arch/x86/crypto/poly1305_glue.c:198 crypto_poly1305_update+0x28/0x40 arch/x86/crypto/poly1305_glue.c:230 bch2_checksum+0x5e9/0x770 fs/bcachefs/checksum.c:238 bch2_btree_node_read_done+0x1995/0x5e90 fs/bcachefs/btree_io.c:1060 btree_node_read_work+0x68b/0x1260 fs/bcachefs/btree_io.c:1327 bch2_btree_node_read+0x2433/0x2a10 __bch2_btree_root_read fs/bcachefs/btree_io.c:1753 [inline] bch2_btree_root_read+0x617/0x7a0 fs/bcachefs/btree_io.c:1775 read_btree_roots+0x296/0x840 fs/bcachefs/recovery.c:524 bch2_fs_recovery+0x2585/0x39c0 fs/bcachefs/recovery.c:854 bch2_fs_start+0x356/0x5b0 fs/bcachefs/super.c:1036 bch2_fs_get_tree+0xd68/0x1710 fs/bcachefs/fs.c:2170 vfs_get_tree+0x90/0x2b0 fs/super.c:1800 do_new_mount+0x2be/0xb40 fs/namespace.c:3507 do_mount fs/namespace.c:3847 [inline] __do_sys_mount fs/namespace.c:4057 [inline] __se_sys_mount+0x2d6/0x3c0 fs/namespace.c:4034 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fd60bb7feba Code: d8 64 89 02 48 c7 c0 ff ff ff ff eb a6 e8 de 1a 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 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fd60c8c5e68 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 00007fd60c8c5ef0 RCX: 00007fd60bb7feba RDX: 000000002000f640 RSI: 0000000020000400 RDI: 00007fd60c8c5eb0 RBP: 000000002000f640 R08: 00007fd60c8c5ef0 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000020000400 R13: 00007fd60c8c5eb0 R14: 000000000000f623 R15: 0000000020000100 The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x51a20 flags: 0x4fff00000000000(node=1|zone=1|lastcpupid=0x7ff) raw: 04fff00000000000 ffffea0001468888 ffffea0001462f88 0000000000000000 raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner info is not present (never set?) Memory state around the buggy address: ffff888051a1ff80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888051a20000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff888051a20080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff888051a20100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888051a20180: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================