loop0: detected capacity change from 0 to 16384 bcachefs (loop0): starting version 1.13: inode_has_child_snapshots opts=metadata_checksum=none,data_checksum=none features: new_siphash,inline_data,new_extent_overwrite,btree_ptr_v2,new_varint,journal_no_flush,alloc_v2,extents_across_btree_nodes bcachefs (loop0): Using encoding defined by superblock: utf8-12.1.0 bcachefs (loop0): invalid bkey in superblock btree=accounting level=1: u64s 11 type btree_ptr_v2 SPOS_MAX len 0 ver 0: seq 2964fe5219fc11c5 written 16 min_key 347136:0:0 durability: 0 (invalid extent entry 0000000000017200) invalid extent entry type (got 9, max 7), deleting bcachefs (loop0): recovering from clean shutdown, journal seq 15 bcachefs (loop0): Doing compatible version upgrade from 1.13: inode_has_child_snapshots to 1.28: inode_has_case_insensitive running recovery passes: check_allocations,check_extents_to_backpointers,check_inodes ================================================================== BUG: KASAN: use-after-free in string_nocheck lib/vsprintf.c:653 [inline] BUG: KASAN: use-after-free in string+0x231/0x2b0 lib/vsprintf.c:735 Read of size 1 at addr ffff888054c6f4f7 by task syz.0.0/5362 CPU: 0 UID: 0 PID: 5362 Comm: syz.0.0 Not tainted syzkaller #0 PREEMPT(full) 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_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 string_nocheck lib/vsprintf.c:653 [inline] string+0x231/0x2b0 lib/vsprintf.c:735 vsnprintf+0x739/0xf00 lib/vsprintf.c:2926 bch2_prt_printf+0x1c6/0x740 fs/bcachefs/printbuf.c:183 bch2_dirent_to_text+0x2bd/0xd20 fs/bcachefs/dirent.c:220 __bch2_bkey_fsck_err+0x3f7/0x540 fs/bcachefs/error.c:691 bch2_dirent_validate+0x7b3/0xfb0 fs/bcachefs/dirent.c:164 bch2_bkey_val_validate+0x202/0x3e0 fs/bcachefs/bkey_methods.c:143 btree_node_bkey_val_validate fs/bcachefs/btree_io.c:880 [inline] bch2_btree_node_read_done+0x4051/0x5550 fs/bcachefs/btree_io.c:1303 btree_node_read_work+0x40e/0xe60 fs/bcachefs/btree_io.c:1440 bch2_btree_node_read+0x887/0x2a00 fs/bcachefs/btree_io.c:-1 __bch2_btree_root_read fs/bcachefs/btree_io.c:1906 [inline] bch2_btree_root_read+0x5f0/0x760 fs/bcachefs/btree_io.c:1928 read_btree_roots+0x2c6/0x840 fs/bcachefs/recovery.c:615 bch2_fs_recovery+0x261f/0x3a50 fs/bcachefs/recovery.c:1006 bch2_fs_start+0xaaf/0xda0 fs/bcachefs/super.c:1213 bch2_fs_get_tree+0xb39/0x1520 fs/bcachefs/fs.c:2488 vfs_get_tree+0x8f/0x2b0 fs/super.c:1815 do_new_mount+0x2a2/0x9e0 fs/namespace.c:3808 do_mount fs/namespace.c:4136 [inline] __do_sys_mount fs/namespace.c:4347 [inline] __se_sys_mount+0x317/0x410 fs/namespace.c:4324 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:0x7f0a5879038a 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:00007f0a595d8e68 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 00007f0a595d8ef0 RCX: 00007f0a5879038a RDX: 0000200000000040 RSI: 0000200000004940 RDI: 00007f0a595d8eb0 RBP: 0000200000000040 R08: 00007f0a595d8ef0 R09: 0000000000004000 R10: 0000000000004000 R11: 0000000000000246 R12: 0000200000004940 R13: 00007f0a595d8eb0 R14: 000000000000496e R15: 0000200000000000 The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x54c6f flags: 0x4fff00000000000(node=1|zone=1|lastcpupid=0x7ff) raw: 04fff00000000000 ffffea0001531bc8 ffffea0001531bc8 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: ffff888054c6f380: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888054c6f400: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff888054c6f480: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff888054c6f500: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888054c6f580: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================