loop0: detected capacity change from 0 to 32768 ================================================================== BUG: KASAN: slab-out-of-bounds in journal_entry_dev_usage_to_text+0x12d/0x1d0 fs/bcachefs/journal_io.c:717 Read of size 8 at addr ffff88804cb8e000 by task syz.0.0/5326 CPU: 0 UID: 0 PID: 5326 Comm: syz.0.0 Not tainted 6.12.0-rc5-syzkaller-00181-g6c52d4da1c74 #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 journal_entry_dev_usage_to_text+0x12d/0x1d0 fs/bcachefs/journal_io.c:717 bch2_sb_clean_to_text+0x138/0x240 fs/bcachefs/sb-clean.c:252 bch2_sb_field_validate+0x201/0x2e0 fs/bcachefs/super-io.c:1239 bch2_sb_validate+0xbb1/0xf70 fs/bcachefs/super-io.c:475 __bch2_read_super+0xc24/0x1380 fs/bcachefs/super-io.c:832 bch2_fs_open+0x270/0x2f80 fs/bcachefs/super.c:2032 bch2_fs_get_tree+0x738/0x1710 fs/bcachefs/fs.c:2157 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:0x7f991597feba 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:00007f99166dfe68 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 00007f99166dfef0 RCX: 00007f991597feba RDX: 00000000200058c0 RSI: 0000000020005900 RDI: 00007f99166dfeb0 RBP: 00000000200058c0 R08: 00007f99166dfef0 R09: 0000000000000400 R10: 0000000000000400 R11: 0000000000000246 R12: 0000000020005900 R13: 00007f99166dfeb0 R14: 00000000000059c5 R15: 00000000200001c0 Allocated by task 5326: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 poison_kmalloc_redzone mm/kasan/common.c:377 [inline] __kasan_kmalloc+0x98/0xb0 mm/kasan/common.c:394 kasan_kmalloc include/linux/kasan.h:257 [inline] __do_kmalloc_node mm/slub.c:4264 [inline] __kmalloc_node_track_caller_noprof+0x225/0x440 mm/slub.c:4283 __do_krealloc mm/slab_common.c:1220 [inline] krealloc_noprof+0x88/0x120 mm/slab_common.c:1269 bch2_sb_realloc+0x2d2/0x660 fs/bcachefs/super-io.c:189 read_one_super+0x73b/0xf40 fs/bcachefs/super-io.c:667 __bch2_read_super+0x87c/0x1380 fs/bcachefs/super-io.c:758 bch2_fs_open+0x270/0x2f80 fs/bcachefs/super.c:2032 bch2_fs_get_tree+0x738/0x1710 fs/bcachefs/fs.c:2157 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 The buggy address belongs to the object at ffff88804cb8c000 which belongs to the cache kmalloc-8k of size 8192 The buggy address is located 0 bytes to the right of allocated 8192-byte region [ffff88804cb8c000, ffff88804cb8e000) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x4cb88 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0x4fff00000000040(head|node=1|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 04fff00000000040 ffff88801ac42280 dead000000000122 0000000000000000 raw: 0000000000000000 0000000000020002 00000001f5000000 0000000000000000 head: 04fff00000000040 ffff88801ac42280 dead000000000122 0000000000000000 head: 0000000000000000 0000000000020002 00000001f5000000 0000000000000000 head: 04fff00000000003 ffffea000132e201 ffffffffffffffff 0000000000000000 head: 0000000000000008 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Unmovable, gfp_mask 0x52820(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP), pid 5320, tgid 5320 (kworker/0:4), ts 57550322232, free_ts 0 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1f3/0x230 mm/page_alloc.c:1537 prep_new_page mm/page_alloc.c:1545 [inline] get_page_from_freelist+0x303f/0x3190 mm/page_alloc.c:3457 __alloc_pages_noprof+0x292/0x710 mm/page_alloc.c:4733 alloc_pages_mpol_noprof+0x3e8/0x680 mm/mempolicy.c:2265 alloc_slab_page+0x6a/0x120 mm/slub.c:2412 allocate_slab+0x5a/0x2f0 mm/slub.c:2578 new_slab mm/slub.c:2631 [inline] ___slab_alloc+0xcd1/0x14b0 mm/slub.c:3818 __slab_alloc+0x58/0xa0 mm/slub.c:3908 __slab_alloc_node mm/slub.c:3961 [inline] slab_alloc_node mm/slub.c:4122 [inline] __do_kmalloc_node mm/slub.c:4263 [inline] __kmalloc_noprof+0x25a/0x400 mm/slub.c:4276 kmalloc_noprof include/linux/slab.h:882 [inline] kmalloc_array_noprof include/linux/slab.h:923 [inline] __sta_info_alloc+0xbcb/0x1ea0 net/mac80211/sta_info.c:616 ieee80211_ibss_rx_no_sta+0x3c8/0x720 net/mac80211/ibss.c:1211 ieee80211_accept_frame net/mac80211/rx.c:4469 [inline] ieee80211_prepare_and_rx_handle+0x228a/0x6360 net/mac80211/rx.c:5041 __ieee80211_rx_handle_packet net/mac80211/rx.c:5327 [inline] ieee80211_rx_list+0x2ce0/0x3780 net/mac80211/rx.c:5462 ieee80211_rx_napi+0x18a/0x3c0 net/mac80211/rx.c:5485 ieee80211_rx include/net/mac80211.h:5138 [inline] ieee80211_handle_queued_frames+0xe7/0x1e0 net/mac80211/main.c:441 tasklet_action_common+0x321/0x4d0 kernel/softirq.c:784 page_owner free stack trace missing Memory state around the buggy address: ffff88804cb8df00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88804cb8df80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff88804cb8e000: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff88804cb8e080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88804cb8e100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================