================================================================== BUG: KASAN: use-after-free in __xfrm_state_lookup_all net/xfrm/xfrm_state.c:-1 [inline] BUG: KASAN: use-after-free in xfrm_state_find+0x2cf2/0x5400 net/xfrm/xfrm_state.c:1494 Read of size 1 at addr ffff88803388e0f0 by task syz.3.931/8918 CPU: 0 UID: 0 PID: 8918 Comm: syz.3.931 Not tainted syzkaller #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2025 Call Trace: dump_stack_lvl+0x189/0x250 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0xca/0x240 mm/kasan/report.c:482 kasan_report+0x118/0x150 mm/kasan/report.c:595 __xfrm_state_lookup_all net/xfrm/xfrm_state.c:-1 [inline] xfrm_state_find+0x2cf2/0x5400 net/xfrm/xfrm_state.c:1494 xfrm_tmpl_resolve_one net/xfrm/xfrm_policy.c:2522 [inline] xfrm_tmpl_resolve net/xfrm/xfrm_policy.c:2573 [inline] xfrm_resolve_and_create_bundle+0x768/0x2f80 net/xfrm/xfrm_policy.c:2871 xfrm_bundle_lookup net/xfrm/xfrm_policy.c:3106 [inline] xfrm_lookup_with_ifid+0x58a/0x1a70 net/xfrm/xfrm_policy.c:3237 xfrm_lookup net/xfrm/xfrm_policy.c:3336 [inline] xfrm_lookup_route+0x3c/0x1c0 net/xfrm/xfrm_policy.c:3347 ip_route_connect include/net/route.h:355 [inline] __ip4_datagram_connect+0x9a5/0x1270 net/ipv4/datagram.c:49 ip4_datagram_connect+0x2d/0x50 net/ipv4/datagram.c:92 __sys_connect_file net/socket.c:2086 [inline] __sys_connect+0x316/0x440 net/socket.c:2105 __do_sys_connect net/socket.c:2111 [inline] __se_sys_connect net/socket.c:2108 [inline] __x64_sys_connect+0x7a/0x90 net/socket.c:2108 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0xfa0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fdcd0b8ebe9 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:00007fdcd1adc038 EFLAGS: 00000246 ORIG_RAX: 000000000000002a RAX: ffffffffffffffda RBX: 00007fdcd0db5fa0 RCX: 00007fdcd0b8ebe9 RDX: 0000000000000010 RSI: 00002000000000c0 RDI: 0000000000000006 RBP: 00007fdcd0c11e19 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fdcd0db6038 R14: 00007fdcd0db5fa0 R15: 00007fff63a74c68 The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x3388e flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000000 0000000000000000 ffffea0000ce2390 0000000000000000 raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as freed page last allocated via order 2, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 8549, tgid 8549 (syz-executor), ts 193819493264, free_ts 202108449002 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x240/0x2a0 mm/page_alloc.c:1851 prep_new_page mm/page_alloc.c:1859 [inline] get_page_from_freelist+0x21e4/0x22c0 mm/page_alloc.c:3858 __alloc_frozen_pages_noprof+0x181/0x370 mm/page_alloc.c:5148 alloc_pages_mpol+0x232/0x4a0 mm/mempolicy.c:2416 alloc_slab_page mm/slub.c:2487 [inline] allocate_slab+0x8a/0x330 mm/slub.c:2655 new_slab mm/slub.c:2709 [inline] ___slab_alloc+0xbd1/0x13e0 mm/slub.c:3891 __slab_alloc mm/slub.c:3981 [inline] __slab_alloc_node mm/slub.c:4056 [inline] slab_alloc_node mm/slub.c:4217 [inline] kmem_cache_alloc_node_noprof+0x26c/0x390 mm/slub.c:4281 kmalloc_reserve+0xbd/0x290 net/core/skbuff.c:578 __alloc_skb+0x142/0x2d0 net/core/skbuff.c:669 alloc_skb include/linux/skbuff.h:1377 [inline] nlmsg_new include/net/netlink.h:1055 [inline] genlmsg_new include/net/genetlink.h:611 [inline] ethnl_default_notify+0x5da/0xb70 net/ethtool/netlink.c:1013 ethtool_notify net/ethtool/netlink.c:1091 [inline] ethnl_notify_features net/ethtool/netlink.c:1099 [inline] ethnl_netdev_event+0xe2/0x160 net/ethtool/netlink.c:1114 notifier_call_chain+0x1b3/0x3e0 kernel/notifier.c:85 call_netdevice_notifiers_extack net/core/dev.c:2267 [inline] call_netdevice_notifiers net/core/dev.c:2281 [inline] netdev_features_change net/core/dev.c:1570 [inline] netdev_change_features+0x8d/0xd0 net/core/dev.c:10894 team_add_slave+0x1d84/0x26f0 drivers/net/team/team_core.c:1980 do_set_master+0x530/0x6d0 net/core/rtnetlink.c:2948 do_setlink+0xcf0/0x41c0 net/core/rtnetlink.c:3150 page last free pid 5858 tgid 5858 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1395 [inline] __free_frozen_pages+0xbc4/0xd30 mm/page_alloc.c:2895 discard_slab mm/slub.c:2753 [inline] __put_partials+0x146/0x170 mm/slub.c:3218 put_cpu_partial+0x17c/0x250 mm/slub.c:3293 __slab_free+0x2b9/0x390 mm/slub.c:4550 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x97/0x140 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x148/0x160 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x22/0x80 mm/kasan/common.c:349 kasan_slab_alloc include/linux/kasan.h:250 [inline] slab_post_alloc_hook mm/slub.c:4180 [inline] slab_alloc_node mm/slub.c:4229 [inline] kmem_cache_alloc_noprof+0x1ad/0x390 mm/slub.c:4236 ptlock_alloc mm/memory.c:7289 [inline] ptlock_init include/linux/mm.h:3009 [inline] pmd_ptlock_init include/linux/mm.h:3137 [inline] pagetable_pmd_ctor include/linux/mm.h:3165 [inline] pmd_alloc_one_noprof include/asm-generic/pgalloc.h:145 [inline] __pmd_alloc+0xc6/0x3b0 mm/memory.c:6578 pmd_alloc include/linux/mm.h:2900 [inline] copy_pmd_range+0x7ae9/0x7f00 mm/memory.c:1370 copy_pud_range mm/memory.c:1426 [inline] copy_p4d_range mm/memory.c:1450 [inline] copy_page_range+0xc14/0x1270 mm/memory.c:1538 dup_mmap+0xf57/0x1ac0 mm/mmap.c:1834 dup_mm kernel/fork.c:1488 [inline] copy_mm+0x13c/0x4b0 kernel/fork.c:1540 copy_process+0x1706/0x3c00 kernel/fork.c:2178 kernel_clone+0x21e/0x840 kernel/fork.c:2608 __do_sys_clone kernel/fork.c:2751 [inline] __se_sys_clone kernel/fork.c:2735 [inline] __x64_sys_clone+0x18b/0x1e0 kernel/fork.c:2735 Memory state around the buggy address: ffff88803388df80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88803388e000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff88803388e080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff88803388e100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88803388e180: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================