================================================================== BUG: KASAN: slab-use-after-free in __xfrm_state_lookup_all net/xfrm/xfrm_state.c:-1 [inline] BUG: KASAN: slab-use-after-free in xfrm_state_find+0x2635/0x4510 net/xfrm/xfrm_state.c:1284 Read of size 1 at addr ffff88805e69e2f8 by task syz.1.965/8838 CPU: 1 PID: 8838 Comm: syz.1.965 Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2025 Call Trace: dump_stack_lvl+0x16c/0x230 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:364 [inline] print_report+0xac/0x220 mm/kasan/report.c:468 kasan_report+0x117/0x150 mm/kasan/report.c:581 __xfrm_state_lookup_all net/xfrm/xfrm_state.c:-1 [inline] xfrm_state_find+0x2635/0x4510 net/xfrm/xfrm_state.c:1284 xfrm_tmpl_resolve_one net/xfrm/xfrm_policy.c:2502 [inline] xfrm_tmpl_resolve net/xfrm/xfrm_policy.c:2547 [inline] xfrm_resolve_and_create_bundle+0x727/0x2c20 net/xfrm/xfrm_policy.c:2841 xfrm_bundle_lookup net/xfrm/xfrm_policy.c:3076 [inline] xfrm_lookup_with_ifid+0x556/0x19c0 net/xfrm/xfrm_policy.c:3207 xfrm_lookup net/xfrm/xfrm_policy.c:3304 [inline] xfrm_lookup_route+0x3c/0x1b0 net/xfrm/xfrm_policy.c:3315 ip_route_output_ports include/net/route.h:177 [inline] ipip6_tunnel_bind_dev+0x215/0x620 net/ipv6/sit.c:1108 ipip6_tunnel_init+0xea/0x600 net/ipv6/sit.c:1451 register_netdevice+0x66c/0x1ae0 net/core/dev.c:10207 ipip6_tunnel_create+0x10c/0x2d0 net/ipv6/sit.c:215 ipip6_tunnel_locate+0x518/0x730 net/ipv6/sit.c:271 ipip6_tunnel_add net/ipv6/sit.c:1293 [inline] ipip6_tunnel_ctl+0x6ae/0x9e0 net/ipv6/sit.c:1357 ip_tunnel_siocdevprivate+0x11d/0x1c0 net/ipv4/ip_tunnel.c:1017 ipip6_tunnel_siocdevprivate+0x349/0x15e0 net/ipv6/sit.c:1376 dev_siocdevprivate net/core/dev_ioctl.c:489 [inline] dev_ifsioc+0xae6/0xe20 net/core/dev_ioctl.c:597 dev_ioctl+0x87a/0x1170 net/core/dev_ioctl.c:811 sock_ioctl+0x726/0x7a0 net/socket.c:1268 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:871 [inline] __se_sys_ioctl+0xfd/0x170 fs/ioctl.c:857 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 RIP: 0033:0x7f88ad98ebe9 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:00007f88ae774038 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007f88adbb5fa0 RCX: 00007f88ad98ebe9 RDX: 0000200000001040 RSI: 00000000000089f1 RDI: 0000000000000003 RBP: 00007f88ada11e19 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f88adbb6038 R14: 00007f88adbb5fa0 R15: 00007ffcff7b0268 Allocated by task 7492: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4e/0x70 mm/kasan/common.c:52 __kasan_slab_alloc+0x6c/0x80 mm/kasan/common.c:328 kasan_slab_alloc include/linux/kasan.h:188 [inline] slab_post_alloc_hook+0x6e/0x4d0 mm/slab.h:767 slab_alloc_node mm/slub.c:3485 [inline] slab_alloc mm/slub.c:3493 [inline] __kmem_cache_alloc_lru mm/slub.c:3500 [inline] kmem_cache_alloc+0x11e/0x2e0 mm/slub.c:3509 kmem_cache_zalloc include/linux/slab.h:711 [inline] xfrm_state_alloc+0x22/0x2a0 net/xfrm/xfrm_state.c:661 __find_acq_core+0x7d8/0x19d0 net/xfrm/xfrm_state.c:1598 xfrm_find_acq+0x6a/0x90 net/xfrm/xfrm_state.c:2070 xfrm_alloc_userspi+0x57a/0xa90 net/xfrm/xfrm_user.c:1613 xfrm_user_rcv_msg+0x596/0x870 net/xfrm/xfrm_user.c:3169 netlink_rcv_skb+0x216/0x480 net/netlink/af_netlink.c:2545 xfrm_netlink_rcv+0x79/0x90 net/xfrm/xfrm_user.c:3191 netlink_unicast_kernel net/netlink/af_netlink.c:1320 [inline] netlink_unicast+0x751/0x8d0 net/netlink/af_netlink.c:1346 netlink_sendmsg+0x8c1/0xbe0 net/netlink/af_netlink.c:1894 sock_sendmsg_nosec net/socket.c:730 [inline] __sock_sendmsg net/socket.c:745 [inline] ____sys_sendmsg+0x5bf/0x950 net/socket.c:2595 ___sys_sendmsg+0x220/0x290 net/socket.c:2649 __sys_sendmsg net/socket.c:2678 [inline] __do_sys_sendmsg net/socket.c:2687 [inline] __se_sys_sendmsg+0x1a5/0x270 net/socket.c:2685 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 The buggy address belongs to the object at ffff88805e69e000 which belongs to the cache xfrm_state of size 848 The buggy address is located 760 bytes inside of freed 848-byte region [ffff88805e69e000, ffff88805e69e350) The buggy address belongs to the physical page: page:ffffea000179a700 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88805e69e000 pfn:0x5e69c head:ffffea000179a700 order:2 entire_mapcount:0 nr_pages_mapped:0 pincount:0 anon flags: 0xfff00000000840(slab|head|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000000840 ffff88801d2ec140 0000000000000000 0000000000000001 raw: ffff88805e69e000 0000000080100000 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 2, migratetype Unmovable, gfp_mask 0x152820(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_HARDWALL), pid 6045, tgid 6044 (syz.2.58), ts 99072856835, free_ts 98950845833 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x1cd/0x210 mm/page_alloc.c:1554 prep_new_page mm/page_alloc.c:1561 [inline] get_page_from_freelist+0x195c/0x19f0 mm/page_alloc.c:3191 __alloc_pages+0x1e3/0x460 mm/page_alloc.c:4457 alloc_slab_page+0x5d/0x170 mm/slub.c:1876 allocate_slab mm/slub.c:2023 [inline] new_slab+0x87/0x2e0 mm/slub.c:2076 ___slab_alloc+0xc6d/0x12f0 mm/slub.c:3230 __slab_alloc mm/slub.c:3329 [inline] __slab_alloc_node mm/slub.c:3382 [inline] slab_alloc_node mm/slub.c:3475 [inline] slab_alloc mm/slub.c:3493 [inline] __kmem_cache_alloc_lru mm/slub.c:3500 [inline] kmem_cache_alloc+0x1b7/0x2e0 mm/slub.c:3509 kmem_cache_zalloc include/linux/slab.h:711 [inline] xfrm_state_alloc+0x22/0x2a0 net/xfrm/xfrm_state.c:661 xfrm_state_find+0x2944/0x4510 net/xfrm/xfrm_state.c:1303 xfrm_tmpl_resolve_one net/xfrm/xfrm_policy.c:2502 [inline] xfrm_tmpl_resolve net/xfrm/xfrm_policy.c:2547 [inline] xfrm_resolve_and_create_bundle+0x727/0x2c20 net/xfrm/xfrm_policy.c:2841 xfrm_lookup_with_ifid+0x261/0x19c0 net/xfrm/xfrm_policy.c:3175 xfrm_lookup net/xfrm/xfrm_policy.c:3304 [inline] xfrm_lookup_route+0x3c/0x1b0 net/xfrm/xfrm_policy.c:3315 rawv6_sendmsg+0xd07/0x17f0 net/ipv6/raw.c:892 sock_sendmsg_nosec net/socket.c:730 [inline] __sock_sendmsg net/socket.c:745 [inline] ____sys_sendmsg+0x5bf/0x950 net/socket.c:2595 ___sys_sendmsg+0x220/0x290 net/socket.c:2649 __sys_sendmmsg+0x275/0x4a0 net/socket.c:2735 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1154 [inline] free_unref_page_prepare+0x7ce/0x8e0 mm/page_alloc.c:2336 free_unref_page+0x32/0x2e0 mm/page_alloc.c:2429 __slab_free+0x35e/0x410 mm/slub.c:3722 qlink_free mm/kasan/quarantine.c:166 [inline] qlist_free_all+0x75/0xe0 mm/kasan/quarantine.c:185 kasan_quarantine_reduce+0x143/0x160 mm/kasan/quarantine.c:292 __kasan_slab_alloc+0x22/0x80 mm/kasan/common.c:305 kasan_slab_alloc include/linux/kasan.h:188 [inline] slab_post_alloc_hook+0x6e/0x4d0 mm/slab.h:767 slab_alloc_node mm/slub.c:3485 [inline] kmem_cache_alloc_node+0x150/0x330 mm/slub.c:3530 __alloc_skb+0x108/0x2c0 net/core/skbuff.c:640 alloc_skb include/linux/skbuff.h:1284 [inline] netlink_alloc_large_skb net/netlink/af_netlink.c:1184 [inline] netlink_sendmsg+0x65b/0xbe0 net/netlink/af_netlink.c:1869 sock_sendmsg_nosec net/socket.c:730 [inline] __sock_sendmsg net/socket.c:745 [inline] ____sys_sendmsg+0x5bf/0x950 net/socket.c:2595 ___sys_sendmsg+0x220/0x290 net/socket.c:2649 __sys_sendmsg net/socket.c:2678 [inline] __do_sys_sendmsg net/socket.c:2687 [inline] __se_sys_sendmsg+0x1a5/0x270 net/socket.c:2685 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 Memory state around the buggy address: ffff88805e69e180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88805e69e200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88805e69e280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88805e69e300: fb fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc ffff88805e69e380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================