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 ffff8880418aa000 by task syz.0.0/5120 CPU: 0 UID: 0 PID: 5120 Comm: syz.0.0 Not tainted 6.12.0-rc3-syzkaller-00183-g6efbea77b390 #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:2161 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:4055 [inline] __se_sys_mount+0x2d6/0x3c0 fs/namespace.c:4032 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:0x7f027197f79a 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:00007f02727bee68 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 00007f02727beef0 RCX: 00007f027197f79a RDX: 0000000020000000 RSI: 0000000020005900 RDI: 00007f02727beeb0 RBP: 0000000020000000 R08: 00007f02727beef0 R09: 0000000000000002 R10: 0000000000000002 R11: 0000000000000246 R12: 0000000020005900 R13: 00007f02727beeb0 R14: 00000000000058f7 R15: 00000000200000c0 Allocated by task 5120: 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:2161 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:4055 [inline] __se_sys_mount+0x2d6/0x3c0 fs/namespace.c:4032 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 ffff8880418a8000 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 [ffff8880418a8000, ffff8880418aa000) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x418a8 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 ffffea0000474600 0000000000000004 raw: 0000000000000000 0000000000020002 00000001f5000000 0000000000000000 head: 04fff00000000040 ffff88801ac42280 ffffea0000474600 0000000000000004 head: 0000000000000000 0000000000020002 00000001f5000000 0000000000000000 head: 04fff00000000003 ffffea0001062a01 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 0xd28c0(GFP_NOWAIT|__GFP_IO|__GFP_FS|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 4813, tgid 4813 (dhcpcd), ts 73986421722, 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+0x3045/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_node_track_caller_noprof+0x281/0x440 mm/slub.c:4283 kmalloc_reserve+0x111/0x2a0 net/core/skbuff.c:609 __alloc_skb+0x1f3/0x440 net/core/skbuff.c:678 alloc_skb include/linux/skbuff.h:1322 [inline] netlink_dump+0x1f7/0xd80 net/netlink/af_netlink.c:2292 netlink_recvmsg+0x6bb/0x11d0 net/netlink/af_netlink.c:1983 sock_recvmsg_nosec net/socket.c:1051 [inline] sock_recvmsg+0x22f/0x280 net/socket.c:1073 ____sys_recvmsg+0x1c6/0x480 net/socket.c:2826 ___sys_recvmsg net/socket.c:2868 [inline] __sys_recvmsg+0x2e6/0x3d0 net/socket.c:2898 page_owner free stack trace missing Memory state around the buggy address: ffff8880418a9f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8880418a9f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff8880418aa000: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff8880418aa080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8880418aa100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================