u64s 11 type btree_ptr_v2 SPOS_MAX len 0 ver 0: seq c6c25c03258c59c5 written 48 min_key 0:36028797018963968:0 durability: 1 ptr: 0:27:0 gen 0 node offset 8/48 bset u64s 2088 bset byte offset 360: bad k->u64s 0 (min 3 max 253), fixing ================================================================== BUG: KASAN: slab-out-of-bounds in unpack_state_init fs/bcachefs/bkey.c:151 [inline] BUG: KASAN: slab-out-of-bounds in __bch2_bkey_unpack_key+0x66/0xdd0 fs/bcachefs/bkey.c:269 Read of size 8 at addr ffff888053574140 by task kworker/0:1H/36 CPU: 0 UID: 0 PID: 36 Comm: kworker/0:1H Not tainted 6.14.0-rc5-syzkaller-00013-g99fa936e8e4f #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 Workqueue: bcachefs_btree_read_complete btree_node_read_work 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:408 [inline] print_report+0x16e/0x5b0 mm/kasan/report.c:521 kasan_report+0x143/0x180 mm/kasan/report.c:634 unpack_state_init fs/bcachefs/bkey.c:151 [inline] __bch2_bkey_unpack_key+0x66/0xdd0 fs/bcachefs/bkey.c:269 __bkey_unpack_key_format_checked fs/bcachefs/bkey.h:407 [inline] __bkey_unpack_key fs/bcachefs/bkey.h:426 [inline] __bkey_disassemble fs/bcachefs/bkey.h:477 [inline] bkey_packed_valid+0x21e/0x6c0 fs/bcachefs/btree_io.c:875 validate_bset_keys+0xeb5/0x1af0 fs/bcachefs/btree_io.c:987 bch2_btree_node_read_done+0x2298/0x6180 fs/bcachefs/btree_io.c:1164 btree_node_read_work+0x6dc/0x1380 fs/bcachefs/btree_io.c:1358 process_one_work kernel/workqueue.c:3238 [inline] process_scheduled_works+0xabe/0x18e0 kernel/workqueue.c:3319 worker_thread+0x870/0xd30 kernel/workqueue.c:3400 kthread+0x7a9/0x920 kernel/kthread.c:464 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:148 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Last potentially related work creation: ------------[ cut here ]------------ pool index 16319 out of bounds (797) for stack id 9a6c3fc0 WARNING: CPU: 0 PID: 36 at lib/stackdepot.c:452 depot_fetch_stack+0x86/0xc0 lib/stackdepot.c:451 Modules linked in: CPU: 0 UID: 0 PID: 36 Comm: kworker/0:1H Not tainted 6.14.0-rc5-syzkaller-00013-g99fa936e8e4f #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 Workqueue: bcachefs_btree_read_complete btree_node_read_work RIP: 0010:depot_fetch_stack+0x86/0xc0 lib/stackdepot.c:451 Code: 83 7c 18 1c 00 74 38 48 01 d8 eb 24 90 0f 0b 90 44 39 f5 72 ca 90 48 c7 c7 63 fc 3a 8e 89 ee 44 89 f2 89 d9 e8 ab e2 53 fc 90 <0f> 0b 90 90 31 c0 5b 41 5e 5d c3 cc cc cc cc 90 0f 0b 90 eb ef 90 RSP: 0000:ffffc90000576d08 EFLAGS: 00010046 RAX: a98b856e26fe2600 RBX: 000000009a6c3fc0 RCX: ffff88801e00c880 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 0000000000003fbf R08: ffffffff81817e32 R09: 1ffff11003f8519a R10: dffffc0000000000 R11: ffffed1003f8519b R12: ffff888053574140 R13: ffffea00014d5d00 R14: 000000000000031d R15: ffffc90000576de0 FS: 0000000000000000(0000) GS:ffff88801fc00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007fabca6ea000 CR3: 0000000012240000 CR4: 0000000000352ef0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: stack_depot_fetch lib/stackdepot.c:714 [inline] stack_depot_print+0x16/0x50 lib/stackdepot.c:752 kasan_print_aux_stacks+0x38/0x70 mm/kasan/report_generic.c:199 describe_object_stacks mm/kasan/report.c:347 [inline] describe_object mm/kasan/report.c:353 [inline] print_address_description mm/kasan/report.c:412 [inline] print_report+0x22b/0x5b0 mm/kasan/report.c:521 kasan_report+0x143/0x180 mm/kasan/report.c:634 unpack_state_init fs/bcachefs/bkey.c:151 [inline] __bch2_bkey_unpack_key+0x66/0xdd0 fs/bcachefs/bkey.c:269 __bkey_unpack_key_format_checked fs/bcachefs/bkey.h:407 [inline] __bkey_unpack_key fs/bcachefs/bkey.h:426 [inline] __bkey_disassemble fs/bcachefs/bkey.h:477 [inline] bkey_packed_valid+0x21e/0x6c0 fs/bcachefs/btree_io.c:875 validate_bset_keys+0xeb5/0x1af0 fs/bcachefs/btree_io.c:987 bch2_btree_node_read_done+0x2298/0x6180 fs/bcachefs/btree_io.c:1164 btree_node_read_work+0x6dc/0x1380 fs/bcachefs/btree_io.c:1358 process_one_work kernel/workqueue.c:3238 [inline] process_scheduled_works+0xabe/0x18e0 kernel/workqueue.c:3319 worker_thread+0x870/0xd30 kernel/workqueue.c:3400 kthread+0x7a9/0x920 kernel/kthread.c:464 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:148 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244