================================================================== BUG: KASAN: slab-out-of-bounds in xfrm_policy_inexact_list_reinsert+0x620/0x6d0 net/xfrm/xfrm_policy.c:855 Read of size 1 at addr ffff8881e5380bd8 by task syz.2.577/2856 CPU: 0 PID: 2856 Comm: syz.2.577 Not tainted 5.4.292-syzkaller-00021-gcd8e74fa0fa3 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025 Call Trace: __dump_stack+0x1e/0x20 lib/dump_stack.c:77 dump_stack+0x15b/0x1b8 lib/dump_stack.c:118 print_address_description+0x8d/0x4c0 mm/kasan/report.c:384 __kasan_report+0xef/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+0x620/0x6d0 net/xfrm/xfrm_policy.c:855 xfrm_policy_inexact_node_merge net/xfrm/xfrm_policy.c:987 [inline] xfrm_policy_inexact_insert_node+0x944/0xb50 net/xfrm/xfrm_policy.c:1043 xfrm_policy_inexact_alloc_chain+0x53a/0xb30 net/xfrm/xfrm_policy.c:1159 xfrm_policy_inexact_insert+0x70/0x1130 net/xfrm/xfrm_policy.c:1202 xfrm_policy_insert+0xe0/0x930 net/xfrm/xfrm_policy.c:1585 xfrm_add_policy+0x4d1/0x830 net/xfrm/xfrm_user.c:1720 xfrm_user_rcv_msg+0x589/0x860 net/xfrm/xfrm_user.c:2775 netlink_rcv_skb+0x1e6/0x430 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+0x88b/0xa40 net/netlink/af_netlink.c:1332 netlink_sendmsg+0x88d/0xb30 net/netlink/af_netlink.c:1900 sock_sendmsg_nosec net/socket.c:638 [inline] __sock_sendmsg net/socket.c:650 [inline] ____sys_sendmsg+0x57b/0x8d0 net/socket.c:2306 ___sys_sendmsg net/socket.c:2360 [inline] __sys_sendmsg+0x28e/0x360 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+0xcf/0x170 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x5c/0xc1 RIP: 0033:0x7fddcc8c7969 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:00007fddcaf30038 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00007fddccaeefa0 RCX: 00007fddcc8c7969 RDX: 0000000000004000 RSI: 0000200000000580 RDI: 0000000000000008 RBP: 00007fddcc949ab1 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007fddccaeefa0 R15: 00007ffd60f44898 Allocated by task 2856: save_stack mm/kasan/common.c:70 [inline] set_track mm/kasan/common.c:78 [inline] __kasan_kmalloc+0x162/0x200 mm/kasan/common.c:529 kasan_kmalloc+0xd/0x20 mm/kasan/common.c:543 __kmalloc+0x12a/0x2f0 mm/slub.c:3913 kmalloc include/linux/slab.h:561 [inline] sk_prot_alloc+0xb5/0x410 net/core/sock.c:1622 sk_alloc+0x38/0x330 net/core/sock.c:1680 pfkey_create+0x12a/0x660 net/key/af_key.c:154 __sock_create+0x3a8/0x740 net/socket.c:1427 sock_create net/socket.c:1478 [inline] __sys_socket+0xec/0x190 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+0xcf/0x170 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x5c/0xc1 Freed by task 359: 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+0x1c3/0x280 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+0xb7/0x180 mm/slub.c:1494 slab_free mm/slub.c:3080 [inline] kfree+0xbe/0x260 mm/slub.c:4071 skb_free_head net/core/skbuff.c:601 [inline] skb_release_data+0x4ea/0x610 net/core/skbuff.c:621 skb_release_all net/core/skbuff.c:675 [inline] __kfree_skb net/core/skbuff.c:689 [inline] consume_skb+0xad/0x240 net/core/skbuff.c:849 netlink_broadcast_filtered+0x1198/0x1290 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+0xed/0x1b0 net/netlink/af_netlink.c:2510 rtnl_notify+0x9a/0xc0 net/core/rtnetlink.c:737 rtmsg_fib+0x71a/0xcb0 net/ipv4/fib_semantics.c:531 fib_table_delete+0xc70/0x1d00 net/ipv4/fib_trie.c:1602 fib_magic net/ipv4/fib_frontend.c:1105 [inline] fib_del_ifaddr+0x15f2/0x1ba0 net/ipv4/fib_frontend.c:1318 fib_inetaddr_event+0xc9/0x310 net/ipv4/fib_frontend.c:1449 notifier_call_chain kernel/notifier.c:98 [inline] __blocking_notifier_call_chain kernel/notifier.c:322 [inline] blocking_notifier_call_chain+0xd9/0x160 kernel/notifier.c:333 __inet_del_ifa+0x7fc/0xd70 net/ipv4/devinet.c:443 inet_del_ifa net/ipv4/devinet.c:480 [inline] inetdev_destroy net/ipv4/devinet.c:320 [inline] inetdev_event+0x65a/0x1030 net/ipv4/devinet.c:1613 notifier_call_chain kernel/notifier.c:98 [inline] __raw_notifier_call_chain kernel/notifier.c:399 [inline] raw_notifier_call_chain+0xa0/0x120 kernel/notifier.c:406 call_netdevice_notifiers_info net/core/dev.c:1670 [inline] call_netdevice_notifiers_extack net/core/dev.c:1682 [inline] call_netdevice_notifiers net/core/dev.c:1696 [inline] rollback_registered_many+0xa75/0xf40 net/core/dev.c:8650 unregister_netdevice_many+0x4b/0x290 net/core/dev.c:9805 ip_tunnel_delete_nets+0x343/0x390 net/ipv4/ip_tunnel.c:1129 ipgre_tap_exit_batch_net+0x22/0x30 net/ipv4/ip_gre.c:1709 ops_exit_list net/core/net_namespace.c:187 [inline] cleanup_net+0x5fd/0xb40 net/core/net_namespace.c:612 process_one_work+0x73b/0xcc0 kernel/workqueue.c:2290 worker_thread+0xa5c/0x13b0 kernel/workqueue.c:2436 kthread+0x31e/0x3a0 kernel/kthread.c:288 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:354 The buggy address belongs to the object at ffff8881e5380800 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 984 bytes inside of 1024-byte region [ffff8881e5380800, ffff8881e5380c00) The buggy address belongs to the page: page:ffffea000794e000 refcount:1 mapcount:0 mapping:ffff8881f5c02280 index:0x0 compound_mapcount: 0 flags: 0x8000000000010200(slab|head) raw: 8000000000010200 0000000000000000 0000000e00000001 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 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC) set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook mm/page_alloc.c:2165 [inline] prep_new_page+0x35e/0x370 mm/page_alloc.c:2171 get_page_from_freelist+0x1296/0x1310 mm/page_alloc.c:3794 __alloc_pages_nodemask+0x202/0x4b0 mm/page_alloc.c:4894 alloc_slab_page+0x3c/0x3b0 mm/slub.c:343 allocate_slab mm/slub.c:1683 [inline] new_slab+0x93/0x420 mm/slub.c:1749 new_slab_objects mm/slub.c:2505 [inline] ___slab_alloc+0x29e/0x420 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+0x17c/0x2d0 mm/slub.c:4449 __kmalloc_reserve net/core/skbuff.c:142 [inline] __alloc_skb+0xdc/0x500 net/core/skbuff.c:210 alloc_skb include/linux/skbuff.h:1080 [inline] netlink_alloc_large_skb net/netlink/af_netlink.c:1178 [inline] netlink_sendmsg+0x5f6/0xb30 net/netlink/af_netlink.c:1875 sock_sendmsg_nosec net/socket.c:638 [inline] __sock_sendmsg net/socket.c:650 [inline] ____sys_sendmsg+0x57b/0x8d0 net/socket.c:2306 ___sys_sendmsg net/socket.c:2360 [inline] __sys_sendmsg+0x28e/0x360 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+0xcf/0x170 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x5c/0xc1 page_owner free stack trace missing Memory state around the buggy address: ffff8881e5380a80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8881e5380b00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff8881e5380b80: 00 00 00 00 00 00 fc fc fc fc fc fc fc fc fc fc ^ ffff8881e5380c00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8881e5380c80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================