==================================================================
BUG: KASAN: slab-use-after-free in __xfrm_state_delete+0x696/0xca0
Write of size 8 at addr ffff88803bda8030 by task syz.2.1439/11120

CPU: 0 UID: 0 PID: 11120 Comm: syz.2.1439 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:__sanitizer_cov_trace_const_cmp8+0x37/0x90
Code: 08 d0 a0 92 65 8b 15 a8 1d e1 10 81 e2 00 01 ff 00 74 11 81 fa 00 01 00 00 75 57 83 b9 3c 16 00 00 00 74 4e 8b 91 18 16 00 00 <83> fa 03 75 43 48 8b 91 20 16 00 00 44 8b 89 1c 16 00 00 49 c1 e1
RSP: 0000:ffffc9000465fa18 EFLAGS: 00000246
RAX: ffffffff81f76afa RBX: ffffea000048b388 RCX: ffff8881050f0000
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: ffffc9000465fbf0 R08: ffffea000048b3c7 R09: 1ffffd4000091678
R10: dffffc0000000000 R11: fffff94000091679 R12: ffffea000048b3e0
R13: 0000000000000221 R14: 1ffffd400009167c R15: 0000000000000001
 filemap_map_pages+0x8fa/0x1740
 __handle_mm_fault+0x34ac/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:0x7f71874646a0
Code: 48 8d ba 18 02 00 00 c6 05 a4 10 ea 00 00 48 89 3d 7d 10 ea 00 48 8d 3d 6e 10 ea 00 48 8d 86 e8 fd ff ff 48 89 3d 80 10 ea 00 <0f> b7 3d f9 a4 1c 00 48 89 05 62 10 ea 00 66 89 3d c3 10 ea 00 48
RSP: 002b:00007ffca73e0e50 EFLAGS: 00010246
RAX: 000000000003fde8 RBX: 0000000000000000 RCX: 0000000000000000
RDX: 0000001b32224000 RSI: 0000000000040000 RDI: 00007f7188305700
RBP: 0000000000000000 R08: 000000000000000a R09: 00007ffca73e0b94
R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000
R13: 00000000000927c0 R14: 0000000000029000 R15: 00007ffca73e1100
 </TASK>

Allocated by task 10630:
 kasan_save_track+0x3e/0x80
 __kasan_slab_alloc+0x6c/0x80
 kmem_cache_alloc_noprof+0x1c1/0x3c0
 xfrm_state_alloc+0x24/0x2f0
 pfkey_add+0x6e4/0x2e00
 pfkey_sendmsg+0xbfe/0x1090
 __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 24:
 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+0x439/0x7d0
 ret_from_fork_asm+0x1a/0x30

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

The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff88803bda8000 pfn:0x3bda8
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 ffff88801afad780 dead000000000122 0000000000000000
raw: ffff88803bda8000 00000000800e000c 00000000f5000000 0000000000000000
head: 00fff00000000040 ffff88801afad780 dead000000000122 0000000000000000
head: ffff88803bda8000 00000000800e000c 00000000f5000000 0000000000000000
head: 00fff00000000002 ffffea0000ef6a01 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 6570, tgid 6569 (syz.1.170), ts 80366118975, free_ts 80330774643
 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/0x1420
 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+0x2a7/0x1a70
 xfrm_lookup_route+0x3c/0x1c0
 ip6_datagram_dst_update+0x75c/0xcb0
 __ip6_datagram_connect+0xbd1/0x1150
 ip6_datagram_connect_v6_only+0x63/0xa0
 __sys_connect+0x316/0x440
page last free pid 6564 tgid 6560 stack trace:
 __free_frozen_pages+0xbc4/0xd30
 stack_depot_save_flags+0x436/0x860
 kasan_save_track+0x4f/0x80
 __kasan_kmalloc+0x93/0xb0
 __kmalloc_cache_noprof+0x230/0x3d0
 __ipv6_dev_mc_inc+0x44f/0xa50
 ipv6_add_dev+0xe54/0x1370
 addrconf_notify+0x8c2/0x1010
 notifier_call_chain+0x1b6/0x3e0
 netif_set_mtu_ext+0x594/0x7d0
 netif_set_mtu+0xa4/0x150
 dev_set_mtu+0x126/0x260
 bond_enslave+0xc3e/0x3870
 do_set_master+0x533/0x6d0
 rtnl_newlink_create+0x677/0xb00
 rtnl_newlink+0x16d6/0x1c70

Memory state around the buggy address:
 ffff88803bda7f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff88803bda7f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff88803bda8000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                     ^
 ffff88803bda8080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88803bda8100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
