loop0: detected capacity change from 0 to 32768 ================================================================== BUG: KASAN: slab-out-of-bounds in bch2_sb_clean_to_text+0x1b4/0x224 fs/bcachefs/sb-clean.c:298 Read of size 1 at addr ffff0000d63ee004 by task syz-executor481/6237 CPU: 1 PID: 6237 Comm: syz-executor481 Not tainted 6.9.0-rc7-syzkaller-gfda5695d692c #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024 Call trace: dump_backtrace+0x1b8/0x1e4 arch/arm64/kernel/stacktrace.c:317 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:324 __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xe4/0x150 lib/dump_stack.c:114 print_address_description mm/kasan/report.c:377 [inline] print_report+0x198/0x538 mm/kasan/report.c:488 kasan_report+0xd8/0x138 mm/kasan/report.c:601 __asan_report_load1_noabort+0x20/0x2c mm/kasan/report_generic.c:378 bch2_sb_clean_to_text+0x1b4/0x224 fs/bcachefs/sb-clean.c:298 __bch2_sb_field_to_text fs/bcachefs/super-io.c:1228 [inline] bch2_sb_field_to_text+0x1a4/0x234 fs/bcachefs/super-io.c:1244 bch2_sb_field_validate+0x1cc/0x298 fs/bcachefs/super-io.c:1211 bch2_sb_validate+0x918/0xbf8 fs/bcachefs/super-io.c:468 __bch2_read_super+0xa4c/0x10a8 fs/bcachefs/super-io.c:822 bch2_read_super+0x38/0x4c fs/bcachefs/super-io.c:842 bch2_fs_open+0x1e0/0xb64 fs/bcachefs/super.c:2049 bch2_mount+0x558/0xe10 fs/bcachefs/fs.c:1903 legacy_get_tree+0xd4/0x16c fs/fs_context.c:662 vfs_get_tree+0x90/0x288 fs/super.c:1779 do_new_mount+0x278/0x900 fs/namespace.c:3352 path_mount+0x590/0xe04 fs/namespace.c:3679 do_mount fs/namespace.c:3692 [inline] __do_sys_mount fs/namespace.c:3898 [inline] __se_sys_mount fs/namespace.c:3875 [inline] __arm64_sys_mount+0x45c/0x594 fs/namespace.c:3875 __invoke_syscall arch/arm64/kernel/syscall.c:34 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:48 el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:133 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:152 el0_svc+0x54/0x168 arch/arm64/kernel/entry-common.c:712 el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:730 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:598 Allocated by task 6237: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x40/0x78 mm/kasan/common.c:68 kasan_save_alloc_info+0x40/0x50 mm/kasan/generic.c:565 poison_kmalloc_redzone mm/kasan/common.c:370 [inline] __kasan_kmalloc+0xac/0xc4 mm/kasan/common.c:387 kasan_kmalloc include/linux/kasan.h:211 [inline] __do_kmalloc_node mm/slub.c:3966 [inline] __kmalloc_node_track_caller+0x2e4/0x544 mm/slub.c:3986 __do_krealloc mm/slab_common.c:1192 [inline] krealloc+0x94/0x148 mm/slab_common.c:1225 bch2_sb_realloc+0x284/0x564 fs/bcachefs/super-io.c:189 read_one_super+0x6c8/0x2614 fs/bcachefs/super-io.c:659 __bch2_read_super+0x714/0x10a8 fs/bcachefs/super-io.c:750 bch2_read_super+0x38/0x4c fs/bcachefs/super-io.c:842 bch2_fs_open+0x1e0/0xb64 fs/bcachefs/super.c:2049 bch2_mount+0x558/0xe10 fs/bcachefs/fs.c:1903 legacy_get_tree+0xd4/0x16c fs/fs_context.c:662 vfs_get_tree+0x90/0x288 fs/super.c:1779 do_new_mount+0x278/0x900 fs/namespace.c:3352 path_mount+0x590/0xe04 fs/namespace.c:3679 do_mount fs/namespace.c:3692 [inline] __do_sys_mount fs/namespace.c:3898 [inline] __se_sys_mount fs/namespace.c:3875 [inline] __arm64_sys_mount+0x45c/0x594 fs/namespace.c:3875 __invoke_syscall arch/arm64/kernel/syscall.c:34 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:48 el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:133 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:152 el0_svc+0x54/0x168 arch/arm64/kernel/entry-common.c:712 el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:730 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:598 The buggy address belongs to the object at ffff0000d63ec000 which belongs to the cache kmalloc-8k of size 8192 The buggy address is located 4 bytes to the right of allocated 8192-byte region [ffff0000d63ec000, ffff0000d63ee000) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1163e8 head: order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0x5ffc00000000840(slab|head|node=0|zone=2|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 05ffc00000000840 ffff0000c0002280 dead000000000122 0000000000000000 raw: 0000000000000000 0000000080020002 00000001ffffffff 0000000000000000 head: 05ffc00000000840 ffff0000c0002280 dead000000000122 0000000000000000 head: 0000000000000000 0000000080020002 00000001ffffffff 0000000000000000 head: 05ffc00000000003 fffffdffc358fa01 fffffdffc358fa48 00000000ffffffff head: 0000000800000000 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff0000d63edf00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff0000d63edf80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff0000d63ee000: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff0000d63ee080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff0000d63ee100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ================================================================== ------------[ cut here ]------------ WARNING: CPU: 1 PID: 6237 at mm/page_alloc.c:4551 __alloc_pages+0x32c/0x6d0 mm/page_alloc.c:4551 Modules linked in: CPU: 1 PID: 6237 Comm: syz-executor481 Tainted: G B 6.9.0-rc7-syzkaller-gfda5695d692c #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024 pstate: 60400005 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : __alloc_pages+0x32c/0x6d0 mm/page_alloc.c:4551 lr : __alloc_pages+0xc8/0x6d0 mm/page_alloc.c:4545 sp : ffff80009a206440 x29: ffff80009a206530 x28: ffff80009a206460 x27: dfff800000000000 x26: ffff700013440c8c x25: 0000000000000000 x24: ffff80009a206480 x23: 0000000000000000 x22: 0000000000040cc0 x21: 1ffff00013440c90 x20: ffff80009a2064a0 x19: 000000000000000b x18: 0000000000000000 x17: 343220656220646c x16: ffff80008adc5540 x15: 0000000000000005 x14: 1ffff00013440c94 x13: 0000000000000000 x12: 0000000000000000 x11: ffff700013440c99 x10: 1ffff00013440c98 x9 : 0000000000000001 x8 : ffff800091f7b000 x7 : 0000000000000000 x6 : 0000000072657620 x5 : ffff0000e1ffffff x4 : 0000000000000000 x3 : 0000000000000020 x2 : 0000000000000008 x1 : 0000000000000000 x0 : ffff80009a2064a0 Call trace: __alloc_pages+0x32c/0x6d0 mm/page_alloc.c:4551 __alloc_pages_node include/linux/gfp.h:238 [inline] alloc_pages_node include/linux/gfp.h:261 [inline] __kmalloc_large_node+0xbc/0x200 mm/slub.c:3911 __do_kmalloc_node mm/slub.c:3954 [inline] __kmalloc_node_track_caller+0x3dc/0x544 mm/slub.c:3986 __do_krealloc mm/slab_common.c:1192 [inline] krealloc+0x94/0x148 mm/slab_common.c:1225 bch2_printbuf_make_room fs/bcachefs/printbuf.c:38 [inline] bch2_prt_printf+0x300/0x5b8 fs/bcachefs/printbuf.c:78 bch2_bkey_to_text+0x1a4/0x26c fs/bcachefs/bkey_methods.c:288 bch2_bkey_val_to_text+0x40/0x140 fs/bcachefs/bkey_methods.c:306 journal_entry_btree_keys_to_text+0x340/0x5b8 fs/bcachefs/journal_io.c:410 bch2_journal_entry_to_text+0x2f8/0x500 fs/bcachefs/journal_io.c:835 bch2_sb_clean_to_text+0x128/0x224 fs/bcachefs/sb-clean.c:302 __bch2_sb_field_to_text fs/bcachefs/super-io.c:1228 [inline] bch2_sb_field_to_text+0x1a4/0x234 fs/bcachefs/super-io.c:1244 bch2_sb_field_validate+0x1cc/0x298 fs/bcachefs/super-io.c:1211 bch2_sb_validate+0x918/0xbf8 fs/bcachefs/super-io.c:468 __bch2_read_super+0xa4c/0x10a8 fs/bcachefs/super-io.c:822 bch2_read_super+0x38/0x4c fs/bcachefs/super-io.c:842 bch2_fs_open+0x1e0/0xb64 fs/bcachefs/super.c:2049 bch2_mount+0x558/0xe10 fs/bcachefs/fs.c:1903 legacy_get_tree+0xd4/0x16c fs/fs_context.c:662 vfs_get_tree+0x90/0x288 fs/super.c:1779 do_new_mount+0x278/0x900 fs/namespace.c:3352 path_mount+0x590/0xe04 fs/namespace.c:3679 do_mount fs/namespace.c:3692 [inline] __do_sys_mount fs/namespace.c:3898 [inline] __se_sys_mount fs/namespace.c:3875 [inline] __arm64_sys_mount+0x45c/0x594 fs/namespace.c:3875 __invoke_syscall arch/arm64/kernel/syscall.c:34 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:48 el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:133 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:152 el0_svc+0x54/0x168 arch/arm64/kernel/entry-common.c:712 el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:730 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:598 irq event stamp: 71059 hardirqs last enabled at (71059): [] raw_spin_rq_unlock_irq+0x14/0x24 kernel/sched/sched.h:1399 hardirqs last disabled at (71058): [] __schedule+0x2bc/0x24e8 kernel/sched/core.c:6634 softirqs last enabled at (70766): [] softirq_handle_end kernel/softirq.c:400 [inline] softirqs last enabled at (70766): [] handle_softirqs+0xa60/0xc34 kernel/softirq.c:582 softirqs last disabled at (70749): [] __do_softirq+0x14/0x20 kernel/softirq.c:588 ---[ end trace 0000000000000000 ]---