loop7: detected capacity change from 0 to 64 ================================================================== BUG: KASAN: slab-out-of-bounds in hfs_bnode_read+0x17b/0x450 fs/hfs/bnode.c:37 Write of size 94 at addr ffff888060b65500 by task syz.7.177/4941 CPU: 1 PID: 4941 Comm: syz.7.177 Not tainted 5.15.180-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025 Call Trace: dump_stack_lvl+0x168/0x230 lib/dump_stack.c:106 print_address_description+0x60/0x2d0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:434 [inline] kasan_report+0xdf/0x130 mm/kasan/report.c:451 check_region_inline mm/kasan/generic.c:-1 [inline] kasan_check_range+0x27b/0x290 mm/kasan/generic.c:189 memcpy+0x3c/0x60 mm/kasan/shadow.c:66 hfs_bnode_read+0x17b/0x450 fs/hfs/bnode.c:37 hfs_bnode_read_key+0x159/0x1f0 fs/hfs/bnode.c:73 hfs_brec_insert+0x809/0xbc0 fs/hfs/brec.c:159 hfs_cat_create+0x353/0x8d0 fs/hfs/catalog.c:118 hfs_create+0x62/0xd0 fs/hfs/dir.c:202 lookup_open fs/namei.c:3462 [inline] open_last_lookups fs/namei.c:3532 [inline] path_openat+0x11e1/0x2f30 fs/namei.c:3739 do_filp_open+0x1b3/0x3e0 fs/namei.c:3769 do_sys_openat2+0x142/0x4a0 fs/open.c:1253 do_sys_open fs/open.c:1269 [inline] __do_sys_open fs/open.c:1277 [inline] __se_sys_open fs/open.c:1273 [inline] __x64_sys_open+0x11b/0x140 fs/open.c:1273 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 RIP: 0033:0x7f203dbaa969 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 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:00007f203ba12038 EFLAGS: 00000246 ORIG_RAX: 0000000000000002 RAX: ffffffffffffffda RBX: 00007f203ddd1fa0 RCX: 00007f203dbaa969 RDX: 0000000000000100 RSI: 000000000014927e RDI: 0000200000000100 RBP: 00007f203dc2cab1 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f203ddd1fa0 R15: 00007fffec978cd8 Allocated by task 4941: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:434 [inline] ____kasan_kmalloc mm/kasan/common.c:513 [inline] __kasan_kmalloc+0xb5/0xf0 mm/kasan/common.c:522 kmalloc include/linux/slab.h:609 [inline] hfs_find_init+0x84/0x1d0 fs/hfs/bfind.c:21 hfs_cat_create+0x175/0x8d0 fs/hfs/catalog.c:96 hfs_create+0x62/0xd0 fs/hfs/dir.c:202 lookup_open fs/namei.c:3462 [inline] open_last_lookups fs/namei.c:3532 [inline] path_openat+0x11e1/0x2f30 fs/namei.c:3739 do_filp_open+0x1b3/0x3e0 fs/namei.c:3769 do_sys_openat2+0x142/0x4a0 fs/open.c:1253 do_sys_open fs/open.c:1269 [inline] __do_sys_open fs/open.c:1277 [inline] __se_sys_open fs/open.c:1273 [inline] __x64_sys_open+0x11b/0x140 fs/open.c:1273 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 Last potentially related work creation: kasan_save_stack+0x35/0x60 mm/kasan/common.c:38 kasan_record_aux_stack+0xb8/0x100 mm/kasan/generic.c:348 __call_rcu kernel/rcu/tree.c:3007 [inline] call_rcu+0x179/0x920 kernel/rcu/tree.c:3087 collapse net/ipv4/fib_trie.c:702 [inline] resize+0x24a9/0x26e0 net/ipv4/fib_trie.c:905 replace+0x46f/0x5c0 net/ipv4/fib_trie.c:529 inflate net/ipv4/fib_trie.c:623 [inline] resize+0x1019/0x26e0 net/ipv4/fib_trie.c:868 trie_rebalance net/ipv4/fib_trie.c:1101 [inline] fib_insert_node net/ipv4/fib_trie.c:1145 [inline] fib_insert_alias+0xabe/0x1210 net/ipv4/fib_trie.c:1159 fib_table_insert+0x79a/0x1de0 net/ipv4/fib_trie.c:1372 fib_magic+0x2c1/0x390 net/ipv4/fib_frontend.c:1092 fib_add_ifaddr+0x140/0x5e0 net/ipv4/fib_frontend.c:1114 fib_inetaddr_event+0x13c/0x1c0 net/ipv4/fib_frontend.c:1428 notifier_call_chain kernel/notifier.c:83 [inline] blocking_notifier_call_chain+0x103/0x1b0 kernel/notifier.c:318 __inet_insert_ifa+0x9e9/0xbc0 net/ipv4/devinet.c:568 inet_rtm_newaddr+0x940/0x1800 net/ipv4/devinet.c:967 rtnetlink_rcv_msg+0x9b9/0xe60 net/core/rtnetlink.c:5650 netlink_rcv_skb+0x1e0/0x430 net/netlink/af_netlink.c:2489 netlink_unicast_kernel net/netlink/af_netlink.c:1311 [inline] netlink_unicast+0x77c/0x920 net/netlink/af_netlink.c:1337 netlink_sendmsg+0x8ab/0xbc0 net/netlink/af_netlink.c:1905 sock_sendmsg_nosec net/socket.c:704 [inline] __sock_sendmsg net/socket.c:716 [inline] __sys_sendto+0x423/0x580 net/socket.c:2063 __do_sys_sendto net/socket.c:2075 [inline] __se_sys_sendto net/socket.c:2071 [inline] __x64_sys_sendto+0xda/0xf0 net/socket.c:2071 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 The buggy address belongs to the object at ffff888060b65500 which belongs to the cache kmalloc-96 of size 96 The buggy address is located 0 bytes inside of 96-byte region [ffff888060b65500, ffff888060b65560) The buggy address belongs to the page: page:ffffea000182d940 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888060b65000 pfn:0x60b65 flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 dead000000000100 dead000000000122 ffff888016841780 raw: ffff888060b65000 000000008020001f 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x12a20(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY), pid 4179, ts 62977567190, free_ts 17556027228 prep_new_page mm/page_alloc.c:2426 [inline] get_page_from_freelist+0x1b77/0x1c60 mm/page_alloc.c:4192 __alloc_pages+0x1e1/0x470 mm/page_alloc.c:5466 alloc_slab_page mm/slub.c:1775 [inline] allocate_slab mm/slub.c:1912 [inline] new_slab+0xc0/0x4b0 mm/slub.c:1975 ___slab_alloc+0x81e/0xdf0 mm/slub.c:3008 __slab_alloc mm/slub.c:3095 [inline] slab_alloc_node mm/slub.c:3186 [inline] slab_alloc mm/slub.c:3228 [inline] kmem_cache_alloc_trace+0x1a5/0x2a0 mm/slub.c:3245 kmalloc include/linux/slab.h:604 [inline] kzalloc include/linux/slab.h:735 [inline] nsim_fib_event_schedule_work drivers/net/netdevsim/fib.c:979 [inline] nsim_fib_event_nb+0xe6/0xf30 drivers/net/netdevsim/fib.c:1032 notifier_call_chain kernel/notifier.c:83 [inline] atomic_notifier_call_chain+0x15d/0x280 kernel/notifier.c:198 call_fib_notifiers+0x2d/0x60 net/core/fib_notifier.c:35 call_fib_entry_notifiers+0x148/0x1f0 net/ipv4/fib_trie.c:105 fib_table_insert+0xdfa/0x1de0 net/ipv4/fib_trie.c:1388 fib_magic+0x2c1/0x390 net/ipv4/fib_frontend.c:1092 fib_add_ifaddr+0x140/0x5e0 net/ipv4/fib_frontend.c:1114 fib_inetaddr_event+0x13c/0x1c0 net/ipv4/fib_frontend.c:1428 notifier_call_chain kernel/notifier.c:83 [inline] blocking_notifier_call_chain+0x103/0x1b0 kernel/notifier.c:318 __inet_insert_ifa+0x9e9/0xbc0 net/ipv4/devinet.c:568 inet_rtm_newaddr+0x940/0x1800 net/ipv4/devinet.c:967 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1340 [inline] free_pcp_prepare mm/page_alloc.c:1391 [inline] free_unref_page_prepare+0x637/0x6c0 mm/page_alloc.c:3317 free_unref_page+0x94/0x280 mm/page_alloc.c:3396 free_contig_range+0x96/0xf0 mm/page_alloc.c:9385 destroy_args+0xef/0x8b0 mm/debug_vm_pgtable.c:1018 debug_vm_pgtable+0x318/0x370 mm/debug_vm_pgtable.c:1331 do_one_initcall+0x1ee/0x680 init/main.c:1302 do_initcall_level+0x137/0x1f0 init/main.c:1375 do_initcalls+0x4b/0x90 init/main.c:1391 kernel_init_freeable+0x3ce/0x560 init/main.c:1615 kernel_init+0x19/0x1b0 init/main.c:1506 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287 Memory state around the buggy address: ffff888060b65400: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc ffff888060b65480: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc >ffff888060b65500: 00 00 00 00 00 00 00 00 00 06 fc fc fc fc fc fc ^ ffff888060b65580: 00 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc ffff888060b65600: 00 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc ==================================================================