================================================================== BUG: KASAN: slab-use-after-free in __hlist_del include/linux/list.h:982 [inline] BUG: KASAN: slab-use-after-free in hlist_del_rcu include/linux/rculist.h:560 [inline] BUG: KASAN: slab-use-after-free in __xfrm_state_delete+0x696/0xca0 net/xfrm/xfrm_state.c:830 Write of size 8 at addr ffff888059e8c470 by task syz.1.1177/9938 CPU: 0 UID: 0 PID: 9938 Comm: syz.1.1177 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 __hlist_del include/linux/list.h:982 [inline] hlist_del_rcu include/linux/rculist.h:560 [inline] __xfrm_state_delete+0x696/0xca0 net/xfrm/xfrm_state.c:830 xfrm_timer_handler+0x18f/0xa00 net/xfrm/xfrm_state.c:716 __run_hrtimer kernel/time/hrtimer.c:1761 [inline] __hrtimer_run_queues+0x52c/0xc60 kernel/time/hrtimer.c:1825 hrtimer_run_softirq+0x187/0x2b0 kernel/time/hrtimer.c:1842 handle_softirqs+0x283/0x870 kernel/softirq.c:579 __do_softirq kernel/softirq.c:613 [inline] invoke_softirq kernel/softirq.c:453 [inline] __irq_exit_rcu+0xca/0x1f0 kernel/softirq.c:680 irq_exit_rcu+0x9/0x30 kernel/softirq.c:696 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1050 [inline] sysvec_apic_timer_interrupt+0xa6/0xc0 arch/x86/kernel/apic/apic.c:1050 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702 RIP: 0010:lockdep_enabled kernel/locking/lockdep.c:121 [inline] RIP: 0010:lock_release+0x70/0x3e0 kernel/locking/lockdep.c:5881 Code: e8 45 f1 08 00 84 c0 75 0d f6 05 3e f7 ef 0d 01 0f 84 ad 02 00 00 83 3d 7d 42 06 0e 00 0f 84 44 02 00 00 65 8b 05 30 23 03 11 <85> c0 0f 85 35 02 00 00 65 4c 8b 3c 25 08 50 a0 92 41 83 bf ec 0a RSP: 0000:ffffc9001c28f0b0 EFLAGS: 00000202 RAX: 0000000000000000 RBX: ffffffff903ec701 RCX: 21b83949f5986a00 RDX: ffffc9001c28f201 RSI: ffffffff8be332e0 RDI: ffffffff8be332a0 RBP: dffffc0000000000 R08: ffffc9001c28fbf0 R09: 0000000000000000 R10: ffffc9001c28f238 R11: fffff52003851e49 R12: ffffc9001c28fc00 R13: ffffffff8172c195 R14: ffffffff8e139ea0 R15: ffffffff8172c195 rcu_lock_release include/linux/rcupdate.h:341 [inline] rcu_read_unlock include/linux/rcupdate.h:871 [inline] class_rcu_destructor include/linux/rcupdate.h:1155 [inline] unwind_next_frame+0x19a9/0x2390 arch/x86/kernel/unwind_orc.c:680 arch_stack_walk+0x11c/0x150 arch/x86/kernel/stacktrace.c:25 stack_trace_save+0x9c/0xe0 kernel/stacktrace.c:122 save_stack+0xf5/0x1f0 mm/page_owner.c:156 __set_page_owner+0x8d/0x4a0 mm/page_owner.c:329 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 folio_alloc_mpol_noprof mm/mempolicy.c:2435 [inline] vma_alloc_folio_noprof+0xe4/0x200 mm/mempolicy.c:2470 folio_prealloc+0x30/0x180 mm/memory.c:-1 wp_page_copy mm/memory.c:3552 [inline] do_wp_page+0x1231/0x5800 mm/memory.c:4013 handle_pte_fault mm/memory.c:6068 [inline] __handle_mm_fault+0x1033/0x5440 mm/memory.c:6195 handle_mm_fault+0x40a/0x8e0 mm/memory.c:6364 do_user_addr_fault+0xa81/0x1390 arch/x86/mm/fault.c:1336 handle_page_fault arch/x86/mm/fault.c:1476 [inline] exc_page_fault+0x76/0xf0 arch/x86/mm/fault.c:1532 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623 RIP: 0033:0x7f19cb84da2c Code: 23 83 c0 01 44 39 d0 75 dc 48 89 f0 25 ff 1f 00 00 49 89 34 c1 41 88 3c 00 31 c0 c3 66 90 41 38 3c 10 74 0b 41 88 3c 10 31 c0 <49> 89 34 d1 c3 b8 01 00 00 00 c3 66 0f 1f 84 00 00 00 00 00 48 83 RSP: 002b:00007ffc2d6e6218 EFLAGS: 00010246 RAX: 0000000000000000 RBX: 00007f19cc6e5720 RCX: 0000000000000000 RDX: 0000000000001057 RSI: ffffffff84841057 RDI: 0000000000000000 RBP: ffffffff84841057 R08: 00007f19cbba0000 R09: 00007f19cbba2000 R10: 000000008484105b R11: 0000000000000000 R12: 0000000000000000 R13: 0000000000000000 R14: ffffffff84841057 R15: 000000000000000e Allocated by task 8407: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:68 unpoison_slab_object mm/kasan/common.c:330 [inline] __kasan_slab_alloc+0x6c/0x80 mm/kasan/common.c:356 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+0x1c1/0x3c0 mm/slub.c:4236 xfrm_state_alloc+0x24/0x2f0 net/xfrm/xfrm_state.c:733 __find_acq_core+0x8a7/0x1c00 net/xfrm/xfrm_state.c:1833 xfrm_find_acq+0x78/0xa0 net/xfrm/xfrm_state.c:2353 xfrm_alloc_userspi+0x6b3/0xc90 net/xfrm/xfrm_user.c:1863 xfrm_user_rcv_msg+0x7a0/0xab0 net/xfrm/xfrm_user.c:3501 netlink_rcv_skb+0x208/0x470 net/netlink/af_netlink.c:2552 xfrm_netlink_rcv+0x79/0x90 net/xfrm/xfrm_user.c:3523 netlink_unicast_kernel net/netlink/af_netlink.c:1320 [inline] netlink_unicast+0x82c/0x9e0 net/netlink/af_netlink.c:1346 netlink_sendmsg+0x805/0xb30 net/netlink/af_netlink.c:1896 sock_sendmsg_nosec net/socket.c:714 [inline] __sock_sendmsg+0x21c/0x270 net/socket.c:729 ____sys_sendmsg+0x505/0x830 net/socket.c:2614 ___sys_sendmsg+0x21f/0x2a0 net/socket.c:2668 __sys_sendmsg net/socket.c:2700 [inline] __do_sys_sendmsg net/socket.c:2705 [inline] __se_sys_sendmsg net/socket.c:2703 [inline] __x64_sys_sendmsg+0x19b/0x260 net/socket.c:2703 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 9: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:68 kasan_save_free_info+0x46/0x50 mm/kasan/generic.c:576 poison_slab_object mm/kasan/common.c:243 [inline] __kasan_slab_free+0x5b/0x80 mm/kasan/common.c:275 kasan_slab_free include/linux/kasan.h:233 [inline] slab_free_hook mm/slub.c:2417 [inline] slab_free mm/slub.c:4680 [inline] kmem_cache_free+0x18f/0x400 mm/slub.c:4782 xfrm_state_free net/xfrm/xfrm_state.c:591 [inline] xfrm_state_gc_destroy net/xfrm/xfrm_state.c:618 [inline] xfrm_state_gc_task+0x52d/0x6b0 net/xfrm/xfrm_state.c:634 process_one_work kernel/workqueue.c:3236 [inline] process_scheduled_works+0xae1/0x17b0 kernel/workqueue.c:3319 worker_thread+0x8a0/0xda0 kernel/workqueue.c:3400 kthread+0x711/0x8a0 kernel/kthread.c:463 ret_from_fork+0x3f9/0x770 arch/x86/kernel/process.c:148 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 The buggy address belongs to the object at ffff888059e8c440 which belongs to the cache xfrm_state of size 928 The buggy address is located 48 bytes inside of freed 928-byte region [ffff888059e8c440, ffff888059e8c7e0) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff888059e8eec0 pfn:0x59e8c head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000040 ffff88801ab378c0 dead000000000122 0000000000000000 raw: ffff888059e8eec0 00000000800f000c 00000000f5000000 0000000000000000 head: 00fff00000000040 ffff88801ab378c0 dead000000000122 0000000000000000 head: ffff888059e8eec0 00000000800f000c 00000000f5000000 0000000000000000 head: 00fff00000000002 ffffea000167a301 00000000ffffffff 00000000ffffffff head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000004 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 2, migratetype Unmovable, gfp_mask 0x52820(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP), pid 6113, tgid 6110 (syz.0.42), ts 97237821729, free_ts 97154073683 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/0x370 mm/slub.c:2655 new_slab mm/slub.c:2709 [inline] ___slab_alloc+0xbeb/0x1410 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_noprof+0x283/0x3c0 mm/slub.c:4236 xfrm_state_alloc+0x24/0x2f0 net/xfrm/xfrm_state.c:733 pfkey_msg2xfrm_state net/key/af_key.c:1122 [inline] pfkey_add+0x6e4/0x2e00 net/key/af_key.c:1504 pfkey_process net/key/af_key.c:2848 [inline] pfkey_sendmsg+0xbfe/0x1090 net/key/af_key.c:3699 sock_sendmsg_nosec net/socket.c:714 [inline] __sock_sendmsg+0x21c/0x270 net/socket.c:729 ____sys_sendmsg+0x505/0x830 net/socket.c:2614 ___sys_sendmsg+0x21f/0x2a0 net/socket.c:2668 __sys_sendmsg net/socket.c:2700 [inline] __do_sys_sendmsg net/socket.c:2705 [inline] __se_sys_sendmsg net/socket.c:2703 [inline] __x64_sys_sendmsg+0x19b/0x260 net/socket.c:2703 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f page last free pid 6111 tgid 6110 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 stack_depot_save_flags+0x436/0x860 lib/stackdepot.c:727 kasan_save_stack mm/kasan/common.c:48 [inline] kasan_save_track+0x4f/0x80 mm/kasan/common.c:68 unpoison_slab_object mm/kasan/common.c:330 [inline] __kasan_slab_alloc+0x6c/0x80 mm/kasan/common.c:356 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_node_noprof+0x1bb/0x3c0 mm/slub.c:4281 kmalloc_reserve+0xbd/0x290 net/core/skbuff.c:578 pskb_expand_head+0x18e/0x1150 net/core/skbuff.c:2240 netlink_trim+0x1d5/0x2e0 net/netlink/af_netlink.c:1301 netlink_broadcast_filtered+0xd6/0x12c0 net/netlink/af_netlink.c:1514 nlmsg_multicast_filtered include/net/netlink.h:1165 [inline] nlmsg_multicast include/net/netlink.h:1184 [inline] nlmsg_notify+0xf0/0x1a0 net/netlink/af_netlink.c:2595 nf_tables_gen_notify net/netfilter/nf_tables_api.c:9856 [inline] nf_tables_commit+0x78ca/0x8700 net/netfilter/nf_tables_api.c:11163 nfnetlink_rcv_batch net/netfilter/nfnetlink.c:574 [inline] nfnetlink_rcv_skb_batch net/netfilter/nfnetlink.c:647 [inline] nfnetlink_rcv+0x1a4b/0x2520 net/netfilter/nfnetlink.c:665 netlink_unicast_kernel net/netlink/af_netlink.c:1320 [inline] netlink_unicast+0x82c/0x9e0 net/netlink/af_netlink.c:1346 netlink_sendmsg+0x805/0xb30 net/netlink/af_netlink.c:1896 sock_sendmsg_nosec net/socket.c:714 [inline] __sock_sendmsg+0x21c/0x270 net/socket.c:729 ____sys_sendmsg+0x505/0x830 net/socket.c:2614 Memory state around the buggy address: ffff888059e8c300: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888059e8c380: 00 00 00 00 fc fc fc fc fc fc fc fc fc fc fc fc >ffff888059e8c400: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb ^ ffff888059e8c480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888059e8c500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ---------------- Code disassembly (best guess): 0: e8 45 f1 08 00 call 0x8f14a 5: 84 c0 test %al,%al 7: 75 0d jne 0x16 9: f6 05 3e f7 ef 0d 01 testb $0x1,0xdeff73e(%rip) # 0xdeff74e 10: 0f 84 ad 02 00 00 je 0x2c3 16: 83 3d 7d 42 06 0e 00 cmpl $0x0,0xe06427d(%rip) # 0xe06429a 1d: 0f 84 44 02 00 00 je 0x267 23: 65 8b 05 30 23 03 11 mov %gs:0x11032330(%rip),%eax # 0x1103235a * 2a: 85 c0 test %eax,%eax <-- trapping instruction 2c: 0f 85 35 02 00 00 jne 0x267 32: 65 4c 8b 3c 25 08 50 mov %gs:0xffffffff92a05008,%r15 39: a0 92 3b: 41 rex.B 3c: 83 .byte 0x83 3d: bf .byte 0xbf 3e: ec in (%dx),%al 3f: 0a .byte 0xa