==================================================================
BUG: KASAN: slab-use-after-free in xfrm_alloc_spi+0xe21/0xf30
Write of size 8 at addr ffff88812ca04370 by task syz.1.1119/9896

CPU: 0 UID: 0 PID: 9896 Comm: syz.1.1119 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:
 <TASK>
 dump_stack_lvl+0x189/0x250
 print_report+0xca/0x240
 kasan_report+0x118/0x150
 xfrm_alloc_spi+0xe21/0xf30
 xfrm_alloc_userspi+0x70b/0xc90
 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
RIP: 0033:0x7fd4de18ec29
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:00007fd4df024038 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 00007fd4de3d5fa0 RCX: 00007fd4de18ec29
RDX: 0000000000000000 RSI: 0000200000000540 RDI: 0000000000000005
RBP: 00007fd4de211e41 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fd4de3d6038 R14: 00007fd4de3d5fa0 R15: 00007ffd13444038
 </TASK>

Allocated by task 9698:
 kasan_save_track+0x3e/0x80
 __kasan_kmalloc+0x93/0xb0
 __kmalloc_noprof+0x27a/0x4f0
 tnode_new+0xc3/0x380
 resize+0x406/0x2710
 fib_insert_alias+0xab7/0x1210
 fib_trie_unmerge+0x310/0xcd0
 fib_unmerge+0xc5/0x360
 fib4_rule_configure+0x2e2/0xa50
 fib_newrule+0x512/0xf20
 rtnetlink_rcv_msg+0x7cf/0xb70
 netlink_rcv_skb+0x208/0x470
 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 5853:
 kasan_save_track+0x3e/0x80
 kasan_save_free_info+0x46/0x50
 __kasan_slab_free+0x5b/0x80
 kfree+0x18e/0x440
 rcu_core+0xcab/0x1770
 handle_softirqs+0x286/0x870
 do_softirq+0xec/0x180
 __local_bh_enable_ip+0x17d/0x1c0
 tcp_close+0x1d/0x110
 inet_release+0x144/0x190
 sock_close+0xc3/0x240
 __fput+0x44c/0xa70
 fput_close_sync+0x119/0x200
 __x64_sys_close+0x7f/0x110
 do_syscall_64+0xfa/0x3b0
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

Last potentially related work creation:
 kasan_save_stack+0x3e/0x60
 kasan_record_aux_stack+0xbd/0xd0
 call_rcu+0x157/0x9c0
 replace+0x238/0x5c0
 resize+0x102a/0x2710
 fib_insert_alias+0xab7/0x1210
 fib_trie_unmerge+0x310/0xcd0
 fib_unmerge+0xc5/0x360
 fib4_rule_configure+0x2e2/0xa50
 fib_newrule+0x512/0xf20
 rtnetlink_rcv_msg+0x7cf/0xb70
 netlink_rcv_skb+0x208/0x470
 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

The buggy address belongs to the object at ffff88812ca04300
 which belongs to the cache kmalloc-128 of size 128
The buggy address is located 112 bytes inside of
 freed 128-byte region [ffff88812ca04300, ffff88812ca04380)

The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff88812ca04100 pfn:0x12ca04
flags: 0x57ff00000000200(workingset|node=1|zone=2|lastcpupid=0x7ff)
page_type: f5(slab)
raw: 057ff00000000200 ffff88801a441a00 ffffea00048c82d0 ffffea0004253f10
raw: ffff88812ca04100 000000000010000c 00000000f5000000 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 0, migratetype Unmovable, gfp_mask 0x252800(GFP_NOWAIT|__GFP_NORETRY|__GFP_COMP|__GFP_THISNODE), pid 8098, tgid 8097 (syz.0.609), ts 108371147721, free_ts 108344897643
 post_alloc_hook+0x240/0x2a0
 get_page_from_freelist+0x21e4/0x22c0
 __alloc_frozen_pages_noprof+0x181/0x370
 allocate_slab+0x65/0x370
 ___slab_alloc+0xbeb/0x1420
 __kmalloc_node_noprof+0x2fd/0x4e0
 allocate_slab+0x16a/0x370
 ___slab_alloc+0xbeb/0x1420
 kmem_cache_alloc_noprof+0x283/0x3c0
 alloc_empty_file+0x55/0x1d0
 alloc_file_pseudo+0x13d/0x210
 sock_alloc_file+0xb8/0x2e0
 __sys_socket+0x13d/0x1b0
 __x64_sys_socket+0x7a/0x90
 do_syscall_64+0xfa/0x3b0
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
page last free pid 5853 tgid 5853 stack trace:
 __free_frozen_pages+0xbc4/0xd30
 __tlb_remove_table+0x2d2/0x3b0
 tlb_remove_table_rcu+0x85/0x100
 rcu_core+0xcab/0x1770
 handle_softirqs+0x286/0x870
 __irq_exit_rcu+0xca/0x1f0
 irq_exit_rcu+0x9/0x30
 sysvec_apic_timer_interrupt+0xa6/0xc0
 asm_sysvec_apic_timer_interrupt+0x1a/0x20

Memory state around the buggy address:
 ffff88812ca04200: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88812ca04280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff88812ca04300: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                                             ^
 ffff88812ca04380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff88812ca04400: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
