================================================================== 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:202 [inline] BUG: KASAN: use-after-free in xfrm6_tunnel_destroy+0x4c9/0x560 net/ipv6/xfrm6_tunnel.c:303 Read of size 8 at addr ffff88819dce1718 by task kworker/0:3/7467 CPU: 0 PID: 7467 Comm: kworker/0:3 Not tainted 4.14.157-syzkaller #0 Workqueue: events xfrm_state_gc_task Call Trace: __dump_stack lib/dump_stack.c:17 [inline] dump_stack+0xe5/0x154 lib/dump_stack.c:58 print_address_description+0x60/0x226 mm/kasan/report.c:187 __kasan_report.cold+0x1a/0x41 mm/kasan/report.c:316 __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:202 [inline] xfrm6_tunnel_destroy+0x4c9/0x560 net/ipv6/xfrm6_tunnel.c:303 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+0x7f1/0x1580 kernel/workqueue.c:2134 worker_thread+0xdd/0xdf0 kernel/workqueue.c:2271 kthread+0x31f/0x430 kernel/kthread.c:232 ret_from_fork+0x3a/0x50 arch/x86/entry/entry_64.S:404 Allocated by task 17195: save_stack mm/kasan/common.c:76 [inline] set_track mm/kasan/common.c:85 [inline] __kasan_kmalloc.part.0+0x53/0xc0 mm/kasan/common.c:501 slab_post_alloc_hook mm/slab.h:439 [inline] slab_alloc_node mm/slub.c:2792 [inline] slab_alloc mm/slub.c:2800 [inline] kmem_cache_alloc+0xee/0x360 mm/slub.c:2805 kmem_cache_zalloc include/linux/slab.h:651 [inline] net_alloc net/core/net_namespace.c:362 [inline] copy_net_ns+0xdd/0x480 net/core/net_namespace.c:402 create_new_namespaces+0x373/0x760 kernel/nsproxy.c:107 unshare_nsproxy_namespaces+0xa5/0x1e0 kernel/nsproxy.c:206 SYSC_unshare kernel/fork.c:2543 [inline] SyS_unshare+0x34e/0x6c0 kernel/fork.c:2493 do_syscall_64+0x19b/0x520 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x42/0xb7 0xffffffffffffffff Freed by task 16743: save_stack mm/kasan/common.c:76 [inline] set_track mm/kasan/common.c:85 [inline] __kasan_slab_free+0x164/0x210 mm/kasan/common.c:463 slab_free_hook mm/slub.c:1407 [inline] slab_free_freelist_hook mm/slub.c:1458 [inline] slab_free mm/slub.c:3039 [inline] kmem_cache_free+0xd7/0x3b0 mm/slub.c:3055 net_free net/core/net_namespace.c:378 [inline] net_drop_ns.part.0+0x59/0x70 net/core/net_namespace.c:385 net_drop_ns net/core/net_namespace.c:384 [inline] cleanup_net+0x4fd/0x870 net/core/net_namespace.c:502 process_one_work+0x7f1/0x1580 kernel/workqueue.c:2134 worker_thread+0xdd/0xdf0 kernel/workqueue.c:2271 kthread+0x31f/0x430 kernel/kthread.c:232 ret_from_fork+0x3a/0x50 arch/x86/entry/entry_64.S:404 0xffffffffffffffff The buggy address belongs to the object at ffff88819dce0000 which belongs to the cache net_namespace of size 7296 The buggy address is located 5912 bytes inside of 7296-byte region [ffff88819dce0000, ffff88819dce1c80) The buggy address belongs to the page: page:ffffea0006773800 count:1 mapcount:0 mapping: (null) index:0x0 compound_mapcount: 0 flags: 0x4000000000010200(slab|head) raw: 4000000000010200 0000000000000000 0000000000000000 0000000180040004 raw: ffffea00067caa00 0000000300000003 ffff8881da97f800 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88819dce1600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88819dce1680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88819dce1700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88819dce1780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88819dce1800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================