================================================================== BUG: KASAN: use-after-free in __read_once_size include/linux/compiler.h:183 [inline] BUG: KASAN: use-after-free in net_generic include/net/netns/generic.h:45 [inline] BUG: KASAN: use-after-free in xfrm6_tunnel_pernet net/ipv6/xfrm6_tunnel.c:50 [inline] BUG: KASAN: use-after-free in xfrm6_tunnel_free_spi net/ipv6/xfrm6_tunnel.c:199 [inline] BUG: KASAN: use-after-free in xfrm6_tunnel_destroy+0x5e3/0x650 net/ipv6/xfrm6_tunnel.c:300 Read of size 8 at addr ffff8801d0759718 by task kworker/0:1/22 CPU: 0 PID: 22 Comm: kworker/0:1 Not tainted 4.14.81+ #6 Workqueue: events xfrm_state_gc_task Call Trace: __dump_stack lib/dump_stack.c:17 [inline] dump_stack+0xb9/0x11b lib/dump_stack.c:53 print_address_description+0x60/0x22b mm/kasan/report.c:252 kasan_report_error mm/kasan/report.c:351 [inline] kasan_report.cold.6+0x11b/0x2dd mm/kasan/report.c:409 __read_once_size include/linux/compiler.h:183 [inline] net_generic include/net/netns/generic.h:45 [inline] xfrm6_tunnel_pernet net/ipv6/xfrm6_tunnel.c:50 [inline] xfrm6_tunnel_free_spi net/ipv6/xfrm6_tunnel.c:199 [inline] xfrm6_tunnel_destroy+0x5e3/0x650 net/ipv6/xfrm6_tunnel.c:300 xfrm_state_gc_destroy net/xfrm/xfrm_state.c:449 [inline] xfrm_state_gc_task+0x3d6/0x550 net/xfrm/xfrm_state.c:470 process_one_work+0x86e/0x1670 kernel/workqueue.c:2114 worker_thread+0xdc/0x1000 kernel/workqueue.c:2248 kthread+0x348/0x420 kernel/kthread.c:232 ret_from_fork+0x3a/0x50 arch/x86/entry/entry_64.S:402 Allocated by task 1847: save_stack mm/kasan/kasan.c:447 [inline] set_track mm/kasan/kasan.c:459 [inline] kasan_kmalloc.part.1+0x4f/0xd0 mm/kasan/kasan.c:551 slab_post_alloc_hook mm/slab.h:442 [inline] slab_alloc_node mm/slub.c:2723 [inline] slab_alloc mm/slub.c:2731 [inline] kmem_cache_alloc+0xe4/0x2b0 mm/slub.c:2736 kmem_cache_zalloc include/linux/slab.h:651 [inline] net_alloc net/core/net_namespace.c:361 [inline] copy_net_ns+0xf2/0x430 net/core/net_namespace.c:401 create_new_namespaces+0x4f0/0x750 kernel/nsproxy.c:107 unshare_nsproxy_namespaces+0x9f/0x1d0 kernel/nsproxy.c:206 SYSC_unshare kernel/fork.c:2377 [inline] SyS_unshare+0x314/0x6b0 kernel/fork.c:2327 do_syscall_64+0x19b/0x4b0 arch/x86/entry/common.c:289 entry_SYSCALL_64_after_hwframe+0x42/0xb7 Freed by task 5: save_stack mm/kasan/kasan.c:447 [inline] set_track mm/kasan/kasan.c:459 [inline] kasan_slab_free+0xac/0x190 mm/kasan/kasan.c:524 slab_free_hook mm/slub.c:1389 [inline] slab_free_freelist_hook mm/slub.c:1410 [inline] slab_free mm/slub.c:2966 [inline] kmem_cache_free+0x12d/0x350 mm/slub.c:2988 net_free net/core/net_namespace.c:377 [inline] net_drop_ns.part.6+0x59/0x70 net/core/net_namespace.c:384 net_drop_ns net/core/net_namespace.c:383 [inline] cleanup_net+0x617/0x880 net/core/net_namespace.c:501 process_one_work+0x86e/0x1670 kernel/workqueue.c:2114 worker_thread+0xdc/0x1000 kernel/workqueue.c:2248 kthread+0x348/0x420 kernel/kthread.c:232 ret_from_fork+0x3a/0x50 arch/x86/entry/entry_64.S:402 The buggy address belongs to the object at ffff8801d0758000 which belongs to the cache net_namespace of size 7296 The buggy address is located 5912 bytes inside of 7296-byte region [ffff8801d0758000, ffff8801d0759c80) The buggy address belongs to the page: page:ffffea000741d600 count:1 mapcount:0 mapping: (null) index:0x0 compound_mapcount: 0 flags: 0x4000000000008100(slab|head) raw: 4000000000008100 0000000000000000 0000000000000000 0000000180040004 raw: dead000000000100 dead000000000200 ffff8801da97f800 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8801d0759600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8801d0759680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8801d0759700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8801d0759780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8801d0759800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================