loop1: detected capacity change from 0 to 32768 ================================================================== BUG: KASAN: slab-out-of-bounds in members_v2_get fs/bcachefs/sb-members.c:68 [inline] BUG: KASAN: slab-out-of-bounds in bch2_sb_members_v2_to_text+0x124/0x228 fs/bcachefs/sb-members.c:347 Read of size 136 at addr ffff0000c5ba5fb8 by task syz.1.856/8470 CPU: 0 UID: 0 PID: 8470 Comm: syz.1.856 Not tainted 6.16.0-rc1-syzkaller-g19272b37aa4f #0 PREEMPT Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025 Call trace: show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:466 (C) __dump_stack+0x30/0x40 lib/dump_stack.c:94 dump_stack_lvl+0xd8/0x12c lib/dump_stack.c:120 print_address_description+0xa8/0x254 mm/kasan/report.c:408 print_report+0x68/0x84 mm/kasan/report.c:521 kasan_report+0xb0/0x110 mm/kasan/report.c:634 check_region_inline mm/kasan/generic.c:-1 [inline] kasan_check_range+0x264/0x2a4 mm/kasan/generic.c:189 __asan_memcpy+0x3c/0x84 mm/kasan/shadow.c:105 members_v2_get fs/bcachefs/sb-members.c:68 [inline] bch2_sb_members_v2_to_text+0x124/0x228 fs/bcachefs/sb-members.c:347 __bch2_sb_field_to_text fs/bcachefs/super-io.c:1397 [inline] bch2_sb_field_to_text+0x1a4/0x234 fs/bcachefs/super-io.c:1413 bch2_sb_field_validate+0x1ac/0x268 fs/bcachefs/super-io.c:1380 bch2_sb_validate+0xee0/0x12d8 fs/bcachefs/super-io.c:552 __bch2_read_super+0x8ac/0xc30 fs/bcachefs/super-io.c:925 bch2_read_super+0x38/0x4c fs/bcachefs/super-io.c:945 bch2_fs_open+0x1d8/0x1fa4 fs/bcachefs/super.c:2372 bch2_fs_get_tree+0x360/0xfd0 fs/bcachefs/fs.c:2473 vfs_get_tree+0x90/0x28c fs/super.c:1802 do_new_mount+0x228/0x814 fs/namespace.c:3885 path_mount+0x5b4/0xde0 fs/namespace.c:4209 do_mount fs/namespace.c:4222 [inline] __do_sys_mount fs/namespace.c:4433 [inline] __se_sys_mount fs/namespace.c:4410 [inline] __arm64_sys_mount+0x3e8/0x468 fs/namespace.c:4410 __invoke_syscall arch/arm64/kernel/syscall.c:35 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:49 el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:132 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:151 el0_svc+0x58/0x17c arch/arm64/kernel/entry-common.c:767 el0t_64_sync_handler+0x78/0x108 arch/arm64/kernel/entry-common.c:786 el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:600 Allocated by task 8470: 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:377 [inline] __kasan_kmalloc+0x9c/0xb4 mm/kasan/common.c:394 kasan_kmalloc include/linux/kasan.h:260 [inline] __do_kmalloc_node mm/slub.c:4328 [inline] __kmalloc_node_track_caller_noprof+0x304/0x4d0 mm/slub.c:4347 __do_krealloc mm/slub.c:4905 [inline] krealloc_noprof+0x11c/0x2f0 mm/slub.c:4958 bch2_sb_realloc+0x240/0x4c4 fs/bcachefs/super-io.c:222 read_one_super+0x358/0x728 fs/bcachefs/super-io.c:759 __bch2_read_super+0x4f8/0xc30 fs/bcachefs/super-io.c:851 bch2_read_super+0x38/0x4c fs/bcachefs/super-io.c:945 bch2_fs_open+0x1d8/0x1fa4 fs/bcachefs/super.c:2372 bch2_fs_get_tree+0x360/0xfd0 fs/bcachefs/fs.c:2473 vfs_get_tree+0x90/0x28c fs/super.c:1802 do_new_mount+0x228/0x814 fs/namespace.c:3885 path_mount+0x5b4/0xde0 fs/namespace.c:4209 do_mount fs/namespace.c:4222 [inline] __do_sys_mount fs/namespace.c:4433 [inline] __se_sys_mount fs/namespace.c:4410 [inline] __arm64_sys_mount+0x3e8/0x468 fs/namespace.c:4410 __invoke_syscall arch/arm64/kernel/syscall.c:35 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:49 el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:132 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:151 el0_svc+0x58/0x17c arch/arm64/kernel/entry-common.c:767 el0t_64_sync_handler+0x78/0x108 arch/arm64/kernel/entry-common.c:786 el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:600 The buggy address belongs to the object at ffff0000c5ba4000 which belongs to the cache kmalloc-8k of size 8192 The buggy address is located 8120 bytes inside of allocated 8192-byte region [ffff0000c5ba4000, ffff0000c5ba6000) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x105ba0 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0x5ffc00000000040(head|node=0|zone=2|lastcpupid=0x7ff) page_type: f5(slab) raw: 05ffc00000000040 ffff0000c0002280 dead000000000122 0000000000000000 raw: 0000000000000000 0000000080020002 00000000f5000000 0000000000000000 head: 05ffc00000000040 ffff0000c0002280 dead000000000122 0000000000000000 head: 0000000000000000 0000000080020002 00000000f5000000 0000000000000000 head: 05ffc00000000003 fffffdffc316e801 00000000ffffffff 00000000ffffffff head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000008 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff0000c5ba5f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff0000c5ba5f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff0000c5ba6000: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff0000c5ba6080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff0000c5ba6100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ================================================================== bcachefs (/dev/loop1): error validating superblock: Invalid superblock section members_v2: section too small (5184 > 152) members_v2 (size 152): Device: 0 Label: (none) UUID: 7af6772b-00de-4159-84cd-1faead05aceb Size: 16777216 read errors: 0 write errors: 0 checksum errors: 0 seqread iops: 0 seqwrite iops: 0 randread iops: 0 randwrite iops: 0 Bucket size: 131072 First bucket: 0 Buckets: 128 Last mount: 1714681267 Last superblock write: 42 State: rw Data allowed: journal,btree,user Has data: (none) Btree allocated bitmap blocksize:256 Btree allocated bitmap: 0000000000000000000001000010000010011000000000000000000000000000 Durability: bcachefs: bch2_fs_get_tree() error: invalid_sb_members