==================================================================
BUG: KASAN: use-after-free in __xfrm_state_delete+0x696/0xca0
Write of size 8 at addr ffff8881225f8030 by task syz.2.1429/9286

CPU: 0 UID: 0 PID: 9286 Comm: syz.2.1429 Not tainted 6.16.0-syzkaller-06588-g759dfc7d04ba-dirty #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:__sanitizer_cov_trace_pc+0x46/0x70
Code: ff 00 74 11 81 fa 00 01 00 00 75 35 83 b9 3c 16 00 00 00 74 2c 8b 91 18 16 00 00 83 fa 02 75 21 48 8b 91 20 16 00 00 48 8b 32 <48> 8d 7e 01 8b 89 1c 16 00 00 48 39 cf 73 08 48 89 3a 48 89 44 f2
RSP: 0018:ffffc90006fd7878 EFLAGS: 00000246
RAX: ffffffff8200d72d RBX: ffff8880335ca8b0 RCX: ffff88803da4b980
RDX: ffffc90003aa2000 RSI: 000000000007ffff RDI: 0000000000080000
RBP: ffffc90006fd79d0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000003 R11: 0000000000000002 R12: 0000000000000000
R13: 000000000000056f R14: 0000000000000f1e R15: ffff8880335ca8e0
 shmem_alloc_and_add_folio+0x41d/0xf60
 shmem_get_folio_gfp+0x59d/0x1660
 shmem_write_begin+0xf7/0x2b0
 generic_perform_write+0x2c5/0x900
 shmem_file_write_iter+0xf8/0x120
 vfs_write+0x54b/0xa90
 ksys_write+0x145/0x250
 do_syscall_64+0xfa/0x3b0
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f11a098eb69
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:00007f11a179f038 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00007f11a0bb5fa0 RCX: 00007f11a098eb69
RDX: 0000000000806000 RSI: 0000200000000200 RDI: 0000000000000005
RBP: 00007f11a0a11df1 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 00007f11a0bb5fa0 R15: 00007ffd07576b98
 </TASK>

The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff8881225f9400 pfn:0x1225f8
flags: 0x57ff00000000000(node=1|zone=2|lastcpupid=0x7ff)
raw: 057ff00000000000 ffffea0004882b08 ffffea0004262e08 0000000000000000
raw: ffff8881225f9400 0000000000100000 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 9051, tgid 9050 (syz.0.1323), ts 87836635513, free_ts 89093245707
 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/0x3b0
 ___slab_alloc+0xbfc/0x1480
 __kmalloc_cache_noprof+0x296/0x3d0
 __genradix_ptr_alloc+0x352/0x4a0
 __genradix_prealloc+0x44/0x90
 sctp_stream_init+0x14b/0x440
 sctp_association_new+0x10dd/0x25f0
 sctp_connect_new_asoc+0x2c5/0x690
 sctp_sendmsg+0x155c/0x2810
 __sock_sendmsg+0x19c/0x270
 __sys_sendto+0x3bd/0x520
 __x64_sys_sendto+0xde/0x100
page last free pid 9093 tgid 9092 stack trace:
 __free_frozen_pages+0xc71/0xe70
 __put_partials+0x161/0x1c0
 put_cpu_partial+0x17c/0x250
 __slab_free+0x2f7/0x400
 qlist_free_all+0x97/0x140
 kasan_quarantine_reduce+0x148/0x160
 __kasan_kmalloc+0x22/0xb0
 __kmalloc_cache_noprof+0x230/0x3d0
 bpf_xdp_link_attach+0x166/0x8f0
 link_create+0x4d8/0x850
 __sys_bpf+0x6dc/0x870
 __x64_sys_bpf+0x7c/0x90
 do_syscall_64+0xfa/0x3b0
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

Memory state around the buggy address:
 ffff8881225f7f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffff8881225f7f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff8881225f8000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
                                     ^
 ffff8881225f8080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff8881225f8100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
==================================================================
