==================================================================
BUG: KASAN: use-after-free in xfrm6_tunnel_free_spi net/ipv6/xfrm6_tunnel.c:208 [inline]
BUG: KASAN: use-after-free in xfrm6_tunnel_destroy+0x52e/0x5d0 net/ipv6/xfrm6_tunnel.c:303
Read of size 8 at addr ffff8880979642b8 by task kworker/1:3/7234

CPU: 1 PID: 7234 Comm: kworker/1:3 Not tainted 4.14.131 #25
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Workqueue: events xfrm_state_gc_task
Call Trace:
 __dump_stack lib/dump_stack.c:17 [inline]
 dump_stack+0x138/0x19c lib/dump_stack.c:53
 print_address_description.cold+0x7c/0x1dc mm/kasan/report.c:252
 kasan_report_error mm/kasan/report.c:351 [inline]
 kasan_report mm/kasan/report.c:409 [inline]
 kasan_report.cold+0xa9/0x2af mm/kasan/report.c:393
 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:430
 xfrm6_tunnel_free_spi net/ipv6/xfrm6_tunnel.c:208 [inline]
 xfrm6_tunnel_destroy+0x52e/0x5d0 net/ipv6/xfrm6_tunnel.c:303
 xfrm_state_gc_destroy net/xfrm/xfrm_state.c:449 [inline]
 xfrm_state_gc_task+0x3ea/0x650 net/xfrm/xfrm_state.c:470
 process_one_work+0x863/0x1600 kernel/workqueue.c:2114
 process_scheduled_works kernel/workqueue.c:2174 [inline]
 worker_thread+0x7f3/0x1050 kernel/workqueue.c:2250
 kthread+0x319/0x430 kernel/kthread.c:232
 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:404

Allocated by task 7219:
 save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59
 save_stack+0x45/0xd0 mm/kasan/kasan.c:447
 set_track mm/kasan/kasan.c:459 [inline]
 kasan_kmalloc mm/kasan/kasan.c:551 [inline]
 kasan_kmalloc+0xce/0xf0 mm/kasan/kasan.c:529
 __do_kmalloc mm/slab.c:3720 [inline]
 __kmalloc+0x15d/0x7a0 mm/slab.c:3729
 kmalloc include/linux/slab.h:493 [inline]
 kzalloc include/linux/slab.h:661 [inline]
 ops_init+0xeb/0x3d0 net/core/net_namespace.c:108
 setup_net+0x237/0x530 net/core/net_namespace.c:295
 copy_net_ns+0x19f/0x440 net/core/net_namespace.c:419
 create_new_namespaces+0x37b/0x720 kernel/nsproxy.c:107
 unshare_nsproxy_namespaces+0xab/0x1e0 kernel/nsproxy.c:206
 SYSC_unshare kernel/fork.c:2406 [inline]
 SyS_unshare+0x2f3/0x7e0 kernel/fork.c:2356
 do_syscall_64+0x1e8/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x42/0xb7

Freed by task 5:
 save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59
 save_stack+0x45/0xd0 mm/kasan/kasan.c:447
 set_track mm/kasan/kasan.c:459 [inline]
 kasan_slab_free+0x75/0xc0 mm/kasan/kasan.c:524
 __cache_free mm/slab.c:3496 [inline]
 kfree+0xcc/0x270 mm/slab.c:3815
 ops_free net/core/net_namespace.c:132 [inline]
 ops_free_list.part.0+0x1f6/0x320 net/core/net_namespace.c:154
 ops_free_list net/core/net_namespace.c:152 [inline]
 cleanup_net+0x458/0x880 net/core/net_namespace.c:488
 process_one_work+0x863/0x1600 kernel/workqueue.c:2114
 worker_thread+0x5d9/0x1050 kernel/workqueue.c:2248
 kthread+0x319/0x430 kernel/kthread.c:232
 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:404

The buggy address belongs to the object at ffff888097964200
 which belongs to the cache kmalloc-8192 of size 8192
The buggy address is located 184 bytes inside of
 8192-byte region [ffff888097964200, ffff888097966200)
The buggy address belongs to the page:
page:ffffea00025e5900 count:1 mapcount:0 mapping:ffff888097964200 index:0x0 compound_mapcount: 0
flags: 0x1fffc0000008100(slab|head)
raw: 01fffc0000008100 ffff888097964200 0000000000000000 0000000100000001
raw: ffffea00025bdd20 ffffea000214ea20 ffff8880aa802080 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff888097964180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff888097964200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff888097964280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                        ^
 ffff888097964300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff888097964380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================