================================================================== BUG: KASAN: slab-out-of-bounds in __xfrm_state_lookup_all net/xfrm/xfrm_state.c:986 [inline] BUG: KASAN: slab-out-of-bounds in xfrm_state_find+0x6b50/0x6d80 net/xfrm/xfrm_state.c:1229 Read of size 8 at addr ffff88807d414898 by task syz-executor.2/10567 CPU: 1 PID: 10567 Comm: syz-executor.2 Not tainted 6.1.0-next-20221215-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd1/0x138 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:306 [inline] print_report+0x15e/0x45d mm/kasan/report.c:417 kasan_report+0xc0/0xf0 mm/kasan/report.c:517 __xfrm_state_lookup_all net/xfrm/xfrm_state.c:986 [inline] xfrm_state_find+0x6b50/0x6d80 net/xfrm/xfrm_state.c:1229 xfrm_tmpl_resolve_one net/xfrm/xfrm_policy.c:2467 [inline] xfrm_tmpl_resolve+0x2f3/0xd40 net/xfrm/xfrm_policy.c:2512 xfrm_resolve_and_create_bundle+0x123/0x2580 net/xfrm/xfrm_policy.c:2805 xfrm_lookup_with_ifid+0x22d/0x20f0 net/xfrm/xfrm_policy.c:3139 xfrm_lookup net/xfrm/xfrm_policy.c:3268 [inline] xfrm_lookup_route+0x3a/0x1e0 net/xfrm/xfrm_policy.c:3279 ip_route_output_flow+0x118/0x150 net/ipv4/route.c:2880 udp_sendmsg+0x1965/0x2750 net/ipv4/udp.c:1231 inet_sendmsg+0x9d/0xe0 net/ipv4/af_inet.c:827 sock_sendmsg_nosec net/socket.c:714 [inline] sock_sendmsg+0xd3/0x120 net/socket.c:734 ____sys_sendmsg+0x334/0x8c0 net/socket.c:2476 ___sys_sendmsg+0x110/0x1b0 net/socket.c:2530 __sys_sendmmsg+0x1b7/0x540 net/socket.c:2616 __do_sys_sendmmsg net/socket.c:2645 [inline] __se_sys_sendmmsg net/socket.c:2642 [inline] __x64_sys_sendmmsg+0x9d/0x100 net/socket.c:2642 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7ff4ed28c0d9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 19 00 00 90 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 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007ff4edf23168 EFLAGS: 00000246 ORIG_RAX: 0000000000000133 RAX: ffffffffffffffda RBX: 00007ff4ed3ac050 RCX: 00007ff4ed28c0d9 RDX: 0400000000000354 RSI: 0000000020000180 RDI: 0000000000000003 RBP: 00007ff4ed2e7ae9 R08: 0000000000000000 R09: 0000000000000000 R10: 000002873dedf99c R11: 0000000000000246 R12: 0000000000000000 R13: 00007fff81a44fcf R14: 00007ff4edf23300 R15: 0000000000022000 Allocated by task 22: kasan_save_stack+0x22/0x40 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:371 [inline] ____kasan_kmalloc mm/kasan/common.c:330 [inline] __kasan_kmalloc+0xa5/0xb0 mm/kasan/common.c:380 kasan_kmalloc include/linux/kasan.h:211 [inline] __do_kmalloc_node mm/slab_common.c:968 [inline] __kmalloc+0x5a/0xd0 mm/slab_common.c:981 kmalloc include/linux/slab.h:584 [inline] kzalloc include/linux/slab.h:720 [inline] xfrm_hash_alloc+0xcf/0xf0 net/xfrm/xfrm_hash.c:21 xfrm_hash_resize+0x9d/0x2150 net/xfrm/xfrm_state.c:167 process_one_work+0x9bf/0x1710 kernel/workqueue.c:2289 worker_thread+0x669/0x1090 kernel/workqueue.c:2436 kthread+0x2e8/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 Last potentially related work creation: kasan_save_stack+0x22/0x40 mm/kasan/common.c:45 __kasan_record_aux_stack+0xbc/0xd0 mm/kasan/generic.c:488 kvfree_call_rcu+0x78/0x8f0 kernel/rcu/tree.c:3374 kernfs_unlink_open_file+0x3a3/0x4a0 fs/kernfs/file.c:633 kernfs_fop_release+0xeb/0x1e0 fs/kernfs/file.c:805 __fput+0x27c/0xa90 fs/file_table.c:320 task_work_run+0x16f/0x270 kernel/task_work.c:179 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] exit_to_user_mode_loop kernel/entry/common.c:171 [inline] exit_to_user_mode_prepare+0x23c/0x250 kernel/entry/common.c:203 __syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline] syscall_exit_to_user_mode+0x1d/0x50 kernel/entry/common.c:296 do_syscall_64+0x46/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x63/0xcd Second to last potentially related work creation: kasan_save_stack+0x22/0x40 mm/kasan/common.c:45 __kasan_record_aux_stack+0xbc/0xd0 mm/kasan/generic.c:488 kvfree_call_rcu+0x78/0x8f0 kernel/rcu/tree.c:3374 __hw_addr_del_entry+0x2ea/0x3c0 net/core/dev_addr_lists.c:161 __hw_addr_del_ex net/core/dev_addr_lists.c:200 [inline] __hw_addr_unsync_one+0x93/0x140 net/core/dev_addr_lists.c:236 __hw_addr_unsync net/core/dev_addr_lists.c:296 [inline] dev_mc_unsync net/core/dev_addr_lists.c:1019 [inline] dev_mc_unsync+0x26f/0x300 net/core/dev_addr_lists.c:1011 vlan_dev_stop+0x55/0x350 net/8021q/vlan_dev.c:315 __dev_close_many+0x1b6/0x2e0 net/core/dev.c:1501 dev_close_many+0x230/0x630 net/core/dev.c:1526 vlan_device_event+0x1871/0x1fa0 net/8021q/vlan.c:449 notifier_call_chain+0xb5/0x200 kernel/notifier.c:87 call_netdevice_notifiers_info+0xb5/0x130 net/core/dev.c:1944 call_netdevice_notifiers_extack net/core/dev.c:1982 [inline] call_netdevice_notifiers net/core/dev.c:1996 [inline] __dev_notify_flags+0x1ea/0x2d0 net/core/dev.c:8571 dev_change_flags+0x11b/0x170 net/core/dev.c:8607 do_setlink+0x9f1/0x3bb0 net/core/rtnetlink.c:2827 rtnl_group_changelink net/core/rtnetlink.c:3344 [inline] __rtnl_newlink+0xb90/0x1840 net/core/rtnetlink.c:3600 rtnl_newlink+0x68/0xa0 net/core/rtnetlink.c:3637 rtnetlink_rcv_msg+0x43e/0xca0 net/core/rtnetlink.c:6141 netlink_rcv_skb+0x165/0x440 net/netlink/af_netlink.c:2564 netlink_unicast_kernel net/netlink/af_netlink.c:1330 [inline] netlink_unicast+0x547/0x7f0 net/netlink/af_netlink.c:1356 netlink_sendmsg+0x91b/0xe10 net/netlink/af_netlink.c:1932 sock_sendmsg_nosec net/socket.c:714 [inline] sock_sendmsg+0xd3/0x120 net/socket.c:734 ____sys_sendmsg+0x712/0x8c0 net/socket.c:2476 ___sys_sendmsg+0x110/0x1b0 net/socket.c:2530 __sys_sendmsg+0xf7/0x1c0 net/socket.c:2559 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd The buggy address belongs to the object at ffff88807d414800 which belongs to the cache kmalloc-128 of size 128 The buggy address is located 24 bytes to the right of 128-byte region [ffff88807d414800, ffff88807d414880) The buggy address belongs to the physical page: page:ffffea0001f50500 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88807d414400 pfn:0x7d414 anon flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 ffff8880124418c0 ffffea0001f82600 dead000000000005 raw: ffff88807d414400 000000008010000b 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 5117, tgid 5117 (syz-executor.5), ts 156916348532, free_ts 156905483791 prep_new_page mm/page_alloc.c:2531 [inline] get_page_from_freelist+0x119e/0x2a80 mm/page_alloc.c:4283 __alloc_pages+0x1cb/0x5b0 mm/page_alloc.c:5549 alloc_pages+0x1aa/0x270 mm/mempolicy.c:2285 alloc_slab_page mm/slub.c:1851 [inline] allocate_slab+0x25f/0x350 mm/slub.c:1998 new_slab mm/slub.c:2051 [inline] ___slab_alloc+0xa91/0x1400 mm/slub.c:3193 __slab_alloc.constprop.0+0x56/0xa0 mm/slub.c:3292 __slab_alloc_node mm/slub.c:3345 [inline] slab_alloc_node mm/slub.c:3442 [inline] __kmem_cache_alloc_node+0x1a4/0x430 mm/slub.c:3491 kmalloc_trace+0x26/0x60 mm/slab_common.c:1062 kmalloc include/linux/slab.h:580 [inline] __hw_addr_create net/core/dev_addr_lists.c:60 [inline] __hw_addr_add_ex+0x22d/0x7e0 net/core/dev_addr_lists.c:118 __dev_mc_add net/core/dev_addr_lists.c:867 [inline] dev_mc_add+0xc1/0x110 net/core/dev_addr_lists.c:885 ip_mc_filter_add net/ipv4/igmp.c:1152 [inline] igmp_group_added+0x766/0x930 net/ipv4/igmp.c:1341 ____ip_mc_inc_group+0x5ae/0xc80 net/ipv4/igmp.c:1475 __ip_mc_inc_group net/ipv4/igmp.c:1484 [inline] ip_mc_inc_group net/ipv4/igmp.c:1490 [inline] ip_mc_up+0x14f/0x370 net/ipv4/igmp.c:1789 inetdev_event+0xbd0/0x16c0 net/ipv4/devinet.c:1578 notifier_call_chain+0xb5/0x200 kernel/notifier.c:87 call_netdevice_notifiers_info+0xb5/0x130 net/core/dev.c:1944 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1446 [inline] free_pcp_prepare+0x4d0/0x9e0 mm/page_alloc.c:1496 free_unref_page_prepare mm/page_alloc.c:3369 [inline] free_unref_page+0x1d/0x490 mm/page_alloc.c:3464 qlink_free mm/kasan/quarantine.c:168 [inline] qlist_free_all+0x6a/0x170 mm/kasan/quarantine.c:187 kasan_quarantine_reduce+0x192/0x220 mm/kasan/quarantine.c:294 __kasan_slab_alloc+0x66/0x90 mm/kasan/common.c:302 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slab.h:761 [inline] slab_alloc_node mm/slub.c:3452 [inline] kmem_cache_alloc_node+0x1f1/0x460 mm/slub.c:3497 __alloc_skb+0x216/0x310 net/core/skbuff.c:552 alloc_skb include/linux/skbuff.h:1270 [inline] alloc_skb_with_frags+0x97/0x6c0 net/core/skbuff.c:6192 sock_alloc_send_pskb+0x7a7/0x930 net/core/sock.c:2741 sock_alloc_send_skb include/net/sock.h:1884 [inline] mld_newpack.isra.0+0x1b9/0x770 net/ipv6/mcast.c:1748 add_grhead+0x295/0x340 net/ipv6/mcast.c:1851 add_grec+0x1082/0x1560 net/ipv6/mcast.c:1989 mld_send_initial_cr.part.0+0xf6/0x230 net/ipv6/mcast.c:2236 mld_send_initial_cr net/ipv6/mcast.c:1232 [inline] ipv6_mc_dad_complete+0x1d4/0x680 net/ipv6/mcast.c:2247 addrconf_dad_completed+0xa01/0xda0 net/ipv6/addrconf.c:4228 addrconf_dad_work+0x75d/0x12d0 net/ipv6/addrconf.c:4157 Memory state around the buggy address: ffff88807d414780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88807d414800: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff88807d414880: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff88807d414900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88807d414980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================