================================================================== BUG: KASAN: slab-out-of-bounds in xfrm_policy_inexact_list_reinsert+0x5b0/0x660 net/xfrm/xfrm_policy.c:855 Read of size 1 at addr ffff8881c2cc4bd8 by task syz.0.2533/9579 CPU: 1 PID: 9579 Comm: syz.0.2533 Tainted: G W 5.4.290-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1d8/0x241 lib/dump_stack.c:118 print_address_description+0x8c/0x600 mm/kasan/report.c:384 __kasan_report+0xf3/0x120 mm/kasan/report.c:516 kasan_report+0x30/0x60 mm/kasan/common.c:653 __asan_report_load1_noabort+0x14/0x20 mm/kasan/generic_report.c:129 xfrm_policy_inexact_list_reinsert+0x5b0/0x660 net/xfrm/xfrm_policy.c:855 xfrm_policy_inexact_node_merge net/xfrm/xfrm_policy.c:987 [inline] xfrm_policy_inexact_insert_node+0x923/0xb10 net/xfrm/xfrm_policy.c:1043 xfrm_policy_inexact_alloc_chain+0x4ec/0xaf0 net/xfrm/xfrm_policy.c:1159 xfrm_policy_inexact_insert+0x6a/0x1160 net/xfrm/xfrm_policy.c:1202 xfrm_policy_insert+0xe7/0x940 net/xfrm/xfrm_policy.c:1585 xfrm_add_policy+0x4f2/0x980 net/xfrm/xfrm_user.c:1720 xfrm_user_rcv_msg+0x689/0x9b0 net/xfrm/xfrm_user.c:2775 netlink_rcv_skb+0x1d5/0x420 net/netlink/af_netlink.c:2467 xfrm_netlink_rcv+0x72/0x90 net/xfrm/xfrm_user.c:2797 netlink_unicast_kernel net/netlink/af_netlink.c:1306 [inline] netlink_unicast+0x936/0xb20 net/netlink/af_netlink.c:1332 netlink_sendmsg+0xa46/0xd00 net/netlink/af_netlink.c:1900 sock_sendmsg_nosec net/socket.c:638 [inline] __sock_sendmsg net/socket.c:650 [inline] ____sys_sendmsg+0x5ac/0x8f0 net/socket.c:2306 ___sys_sendmsg net/socket.c:2360 [inline] __sys_sendmsg+0x28b/0x380 net/socket.c:2406 __do_sys_sendmsg net/socket.c:2415 [inline] __se_sys_sendmsg net/socket.c:2413 [inline] __x64_sys_sendmsg+0x7f/0x90 net/socket.c:2413 do_syscall_64+0xd8/0x170 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x5c/0xc1 RIP: 0033:0x7fe73ddad169 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:00007fe73c416038 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00007fe73dfd4fa0 RCX: 00007fe73ddad169 RDX: 0000000000000000 RSI: 0000200000000580 RDI: 0000000000000006 RBP: 00007fe73de2fa68 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007fe73dfd4fa0 R15: 00007fffa160bbd8 Allocated by task 9579: save_stack mm/kasan/common.c:70 [inline] set_track mm/kasan/common.c:78 [inline] __kasan_kmalloc+0x171/0x210 mm/kasan/common.c:529 kasan_kmalloc+0x9/0x10 mm/kasan/common.c:543 __kmalloc+0x129/0x2e0 mm/slub.c:3913 kmalloc include/linux/slab.h:561 [inline] sk_prot_alloc+0xc2/0x440 net/core/sock.c:1622 sk_alloc+0x39/0x310 net/core/sock.c:1680 pfkey_create+0x12c/0x650 net/key/af_key.c:154 __sock_create+0x3ce/0x790 net/socket.c:1427 sock_create net/socket.c:1478 [inline] __sys_socket+0x132/0x370 net/socket.c:1520 __do_sys_socket net/socket.c:1529 [inline] __se_sys_socket net/socket.c:1527 [inline] __x64_sys_socket+0x7a/0x90 net/socket.c:1527 do_syscall_64+0xd8/0x170 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x5c/0xc1 Freed by task 9138: save_stack mm/kasan/common.c:70 [inline] set_track mm/kasan/common.c:78 [inline] kasan_set_free_info mm/kasan/common.c:345 [inline] __kasan_slab_free+0x1b5/0x270 mm/kasan/common.c:487 kasan_slab_free+0xe/0x10 mm/kasan/common.c:496 slab_free_hook mm/slub.c:1455 [inline] slab_free_freelist_hook mm/slub.c:1494 [inline] slab_free mm/slub.c:3080 [inline] kfree+0x123/0x360 mm/slub.c:4071 skb_free_head net/core/skbuff.c:601 [inline] skb_release_data+0x525/0x650 net/core/skbuff.c:621 skb_release_all net/core/skbuff.c:675 [inline] __kfree_skb net/core/skbuff.c:689 [inline] consume_skb+0xac/0x2a0 net/core/skbuff.c:849 netlink_broadcast_filtered+0x114c/0x1270 net/netlink/af_netlink.c:1516 netlink_broadcast net/netlink/af_netlink.c:1538 [inline] nlmsg_multicast include/net/netlink.h:968 [inline] nlmsg_notify+0x101/0x1c0 net/netlink/af_netlink.c:2510 rtnl_notify+0x9c/0xd0 net/core/rtnetlink.c:737 inet6_rt_notify+0x3c8/0x550 net/ipv6/route.c:6000 fib6_add_rt2node net/ipv6/ip6_fib.c:1187 [inline] fib6_add+0x2444/0x3df0 net/ipv6/ip6_fib.c:1416 __ip6_ins_rt net/ipv6/route.c:1322 [inline] ip6_route_add+0x8a/0x130 net/ipv6/route.c:3766 addrconf_prefix_route net/ipv6/addrconf.c:2443 [inline] fixup_permanent_addr net/ipv6/addrconf.c:3504 [inline] addrconf_permanent_addr+0x761/0xba0 net/ipv6/addrconf.c:3528 addrconf_notify+0x78d/0xec0 net/ipv6/addrconf.c:3598 notifier_call_chain kernel/notifier.c:98 [inline] __raw_notifier_call_chain kernel/notifier.c:399 [inline] raw_notifier_call_chain+0x9f/0x110 kernel/notifier.c:406 __dev_notify_flags+0x26e/0x510 net/core/dev.c:1670 dev_change_flags+0xf0/0x1a0 net/core/dev.c:8034 do_setlink+0xc4c/0x3b70 net/core/rtnetlink.c:2542 __rtnl_newlink net/core/rtnetlink.c:3188 [inline] rtnl_newlink+0x16bc/0x2060 net/core/rtnetlink.c:3314 rtnetlink_rcv_msg+0x983/0xc70 net/core/rtnetlink.c:5290 netlink_rcv_skb+0x1d5/0x420 net/netlink/af_netlink.c:2467 rtnetlink_rcv+0x1c/0x20 net/core/rtnetlink.c:5308 netlink_unicast_kernel net/netlink/af_netlink.c:1306 [inline] netlink_unicast+0x936/0xb20 net/netlink/af_netlink.c:1332 netlink_sendmsg+0xa46/0xd00 net/netlink/af_netlink.c:1900 sock_sendmsg_nosec net/socket.c:638 [inline] __sock_sendmsg net/socket.c:650 [inline] __sys_sendto+0x4f3/0x6c0 net/socket.c:1961 __do_sys_sendto net/socket.c:1973 [inline] __se_sys_sendto net/socket.c:1969 [inline] __x64_sys_sendto+0xe5/0x100 net/socket.c:1969 do_syscall_64+0xd8/0x170 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x5c/0xc1 The buggy address belongs to the object at ffff8881c2cc4800 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 984 bytes inside of 1024-byte region [ffff8881c2cc4800, ffff8881c2cc4c00) The buggy address belongs to the page: page:ffffea00070b3000 refcount:1 mapcount:0 mapping:ffff8881f5c02280 index:0x0 compound_mapcount: 0 flags: 0x8000000000010200(slab|head) raw: 8000000000010200 ffffea0007850a00 0000000600000006 ffff8881f5c02280 raw: 0000000000000000 0000000000100010 00000001ffffffff 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 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL) set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook mm/page_alloc.c:2165 [inline] prep_new_page+0x192/0x370 mm/page_alloc.c:2171 get_page_from_freelist+0x2d13/0x2d90 mm/page_alloc.c:3794 __alloc_pages_nodemask+0x393/0x840 mm/page_alloc.c:4893 alloc_slab_page+0x3b/0x400 mm/slub.c:343 allocate_slab mm/slub.c:1683 [inline] new_slab+0x98/0x430 mm/slub.c:1749 new_slab_objects mm/slub.c:2505 [inline] ___slab_alloc+0x2e0/0x460 mm/slub.c:2667 __slab_alloc+0x63/0xa0 mm/slub.c:2707 slab_alloc_node mm/slub.c:2792 [inline] slab_alloc mm/slub.c:2837 [inline] __kmalloc_track_caller+0x17f/0x2c0 mm/slub.c:4449 __kmalloc_reserve net/core/skbuff.c:142 [inline] __alloc_skb+0xbc/0x4f0 net/core/skbuff.c:210 alloc_skb include/linux/skbuff.h:1080 [inline] alloc_uevent_skb+0x80/0x230 lib/kobject_uevent.c:290 uevent_net_broadcast_tagged lib/kobject_uevent.c:351 [inline] kobject_uevent_net_broadcast+0x188/0x590 lib/kobject_uevent.c:412 kobject_uevent_env+0x53a/0x6f0 lib/kobject_uevent.c:608 kobject_uevent+0x1f/0x30 lib/kobject_uevent.c:657 rx_queue_add_kobject net/core/net-sysfs.c:988 [inline] net_rx_queue_update_kobjects+0x1e3/0x430 net/core/net-sysfs.c:1010 register_queue_kobjects net/core/net-sysfs.c:1632 [inline] netdev_register_kobject+0x231/0x320 net/core/net-sysfs.c:1858 register_netdevice+0xbc5/0x12a0 net/core/dev.c:9209 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1176 [inline] free_pcp_prepare mm/page_alloc.c:1233 [inline] free_unref_page_prepare+0x2a3/0x390 mm/page_alloc.c:3085 free_unref_page mm/page_alloc.c:3134 [inline] free_the_page mm/page_alloc.c:4953 [inline] __free_pages+0xaf/0x140 mm/page_alloc.c:4961 __vunmap+0x730/0x870 mm/vmalloc.c:2260 __vfree mm/vmalloc.c:2308 [inline] vfree+0x5c/0x80 mm/vmalloc.c:2338 kvfree+0x37/0x50 mm/util.c:623 btf_free kernel/bpf/btf.c:902 [inline] btf_parse kernel/bpf/btf.c:3372 [inline] btf_new_fd+0x90c/0x1110 kernel/bpf/btf.c:3416 bpf_btf_load kernel/bpf/syscall.c:2705 [inline] __do_sys_bpf kernel/bpf/syscall.c:2936 [inline] __se_sys_bpf+0x141d/0xbd60 kernel/bpf/syscall.c:2849 __x64_sys_bpf+0x7b/0x90 kernel/bpf/syscall.c:2849 do_syscall_64+0xd8/0x170 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x5c/0xc1 Memory state around the buggy address: ffff8881c2cc4a80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8881c2cc4b00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff8881c2cc4b80: 00 00 00 00 00 00 fc fc fc fc fc fc fc fc fc fc ^ ffff8881c2cc4c00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8881c2cc4c80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================