==================================================================
BUG: KASAN: slab-use-after-free in __xfrm_state_delete+0x696/0xca0
Write of size 8 at addr ffff88803c7ed6b0 by task modprobe/9210

CPU: 0 UID: 0 PID: 9210 Comm: modprobe Not tainted syzkaller #0 PREEMPT(full) 
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014
Call Trace:
 <IRQ>
 dump_stack_lvl+0x189/0x250
 print_report+0xca/0x240
 kasan_report+0x118/0x150
 __xfrm_state_delete+0x696/0xca0
 xfrm_timer_handler+0x18f/0xa00
 __hrtimer_run_queues+0x52c/0xc60
 hrtimer_run_softirq+0x187/0x2b0
 handle_softirqs+0x286/0x870
 __irq_exit_rcu+0xca/0x1f0
 irq_exit_rcu+0x9/0x30
 sysvec_apic_timer_interrupt+0xa6/0xc0
 </IRQ>
 <TASK>
 asm_sysvec_apic_timer_interrupt+0x1a/0x20
RIP: 0010:__list_del_entry_valid_or_report+0xab/0x190
Code: ec 03 43 80 3c 2c 00 74 08 4c 89 ff e8 6e 13 53 fd 49 39 1f 0f 85 92 00 00 00 4d 8d 7e 08 4d 89 fc 49 c1 ec 03 43 80 3c 2c 00 <74> 08 4c 89 ff e8 4b 13 53 fd 49 39 1f 0f 85 9e 00 00 00 b0 01 5b
RSP: 0000:ffffc900094a7330 EFLAGS: 00000246
RAX: 1ffffd400008ce21 RBX: ffffea0000467108 RCX: 0000000000000000
RDX: 0000000000000001 RSI: 1ffffffff1f475ee RDI: ffffea0000467110
RBP: ffffc900094a7550 R08: 0000000000000190 R09: 0000000000000080
R10: dffffc0000000000 R11: ffffffff8b969e8c R12: 1ffffd400009322a
R13: dffffc0000000000 R14: ffffea0000499148 R15: ffffea0000499150
 __rmqueue_pcplist+0x148f/0x1df0
 get_page_from_freelist+0x86a/0x22c0
 __alloc_frozen_pages_noprof+0x181/0x370
 alloc_pages_mpol+0x232/0x4a0
 vma_alloc_folio_noprof+0xe4/0x200
 folio_prealloc+0x30/0x180
 do_wp_page+0x1231/0x5800
 __handle_mm_fault+0x1033/0x5440
 handle_mm_fault+0x40a/0x8e0
 do_user_addr_fault+0xa81/0x1390
 exc_page_fault+0x76/0xf0
 asm_exc_page_fault+0x26/0x30
RIP: 0033:0x7f3a3fa8f21d
Code: 29 c1 48 89 c8 48 89 14 c6 48 83 c2 10 eb 9c 49 8b 07 48 85 c0 74 7b 41 f6 87 1e 03 00 00 20 75 71 49 8b 57 60 48 85 d2 74 04 <48> 01 42 08 49 8b 57 58 48 85 d2 74 04 48 01 42 08 49 8b 57 68 48
RSP: 002b:00007ffed861f2f0 EFLAGS: 00010202
RAX: 00005601d38e3000 RBX: 0000000000000032 RCX: 0000000000000029
RDX: 00005601d38e6e20 RSI: 00007f3a3faa62e0 RDI: 000000006fffffff
RBP: 00007ffed861f590 R08: 000000006ffffdff R09: 000000006ffffeff
R10: 000000006fffff41 R11: 000000006ffffe35 R12: 0000000070000022
R13: 00000000effffef5 R14: 0000000000000000 R15: 00007f3a3faa62a0
 </TASK>

Allocated by task 9021:
 kasan_save_track+0x3e/0x80
 __kasan_slab_alloc+0x6c/0x80
 kmem_cache_alloc_noprof+0x1c1/0x3c0
 xfrm_state_alloc+0x24/0x2f0
 xfrm_add_sa+0x17d1/0x4070
 xfrm_user_rcv_msg+0x7a3/0xab0
 netlink_rcv_skb+0x208/0x470
 xfrm_netlink_rcv+0x79/0x90
 netlink_unicast+0x82f/0x9e0
 netlink_sendmsg+0x805/0xb30
 __sock_sendmsg+0x21c/0x270
 ____sys_sendmsg+0x505/0x830
 ___sys_sendmsg+0x21f/0x2a0
 __x64_sys_sendmsg+0x19b/0x260
 do_syscall_64+0xfa/0x3b0
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

Freed by task 12466:
 kasan_save_track+0x3e/0x80
 kasan_save_free_info+0x46/0x50
 __kasan_slab_free+0x5b/0x80
 kmem_cache_free+0x18f/0x400
 xfrm_state_gc_task+0x52d/0x6b0
 process_scheduled_works+0xae1/0x17b0
 worker_thread+0x8a0/0xda0
 kthread+0x711/0x8a0
 ret_from_fork+0x3fc/0x770
 ret_from_fork_asm+0x1a/0x30

The buggy address belongs to the object at ffff88803c7ed680
 which belongs to the cache xfrm_state of size 928
The buggy address is located 48 bytes inside of
 freed 928-byte region [ffff88803c7ed680, ffff88803c7eda20)

The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff88803c7ef600 pfn:0x3c7ec
head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
ksm flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff)
page_type: f5(slab)
raw: 00fff00000000040 ffff888104eec3c0 ffffea00012b6900 0000000000000003
raw: ffff88803c7ef600 00000000800e000a 00000000f5000000 0000000000000000
head: 00fff00000000040 ffff888104eec3c0 ffffea00012b6900 0000000000000003
head: ffff88803c7ef600 00000000800e000a 00000000f5000000 0000000000000000
head: 00fff00000000002 ffffea0000f1fb01 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 22927, tgid 22926 (syz.2.4809), ts 371288625873, free_ts 364168496573
 post_alloc_hook+0x240/0x2a0
 get_page_from_freelist+0x21e4/0x22c0
 __alloc_frozen_pages_noprof+0x181/0x370
 alloc_pages_mpol+0x232/0x4a0
 allocate_slab+0x8a/0x370
 ___slab_alloc+0xbeb/0x1410
 kmem_cache_alloc_noprof+0x283/0x3c0
 xfrm_state_alloc+0x24/0x2f0
 xfrm_state_find+0x37d4/0x5400
 xfrm_resolve_and_create_bundle+0x768/0x2f80
 xfrm_lookup_with_ifid+0x58a/0x1a70
 xfrm_lookup_route+0x3c/0x1c0
 udp_sendmsg+0x142e/0x2170
 __sock_sendmsg+0x19c/0x270
 ____sys_sendmsg+0x52d/0x830
 ___sys_sendmsg+0x21f/0x2a0
page last free pid 5898 tgid 5898 stack trace:
 __free_frozen_pages+0xbc4/0xd30
 kasan_depopulate_vmalloc_pte+0x74/0xa0
 __apply_to_page_range+0xb92/0x1380
 kasan_release_vmalloc+0xa2/0xd0
 purge_vmap_node+0x214/0x8f0
 process_scheduled_works+0xae1/0x17b0
 worker_thread+0x8a0/0xda0
 kthread+0x711/0x8a0
 ret_from_fork+0x3fc/0x770
 ret_from_fork_asm+0x1a/0x30

Memory state around the buggy address:
 ffff88803c7ed580: fb fb fb fb fc fc fc fc fc fc fc fc fc fc fc fc
 ffff88803c7ed600: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff88803c7ed680: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                     ^
 ffff88803c7ed700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88803c7ed780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
