================================================================== BUG: KASAN: use-after-free in __write_once_size include/linux/compiler.h:220 [inline] BUG: KASAN: use-after-free in __hlist_del include/linux/list.h:702 [inline] BUG: KASAN: use-after-free in hlist_del_init include/linux/list.h:717 [inline] BUG: KASAN: use-after-free in __xfrm_policy_unlink+0x977/0xa00 net/xfrm/xfrm_policy.c:2213 Write of size 8 at addr ffff888098257128 by task kworker/u4:1/25915 CPU: 1 PID: 25915 Comm: kworker/u4:1 Not tainted 5.0.0-rc3+ #37 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: netns cleanup_net Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1db/0x2d0 lib/dump_stack.c:113 print_address_description.cold+0x7c/0x20d mm/kasan/report.c:187 kasan_report.cold+0x1b/0x40 mm/kasan/report.c:317 __asan_report_store8_noabort+0x17/0x20 mm/kasan/generic_report.c:140 __write_once_size include/linux/compiler.h:220 [inline] __hlist_del include/linux/list.h:702 [inline] hlist_del_init include/linux/list.h:717 [inline] __xfrm_policy_unlink+0x977/0xa00 net/xfrm/xfrm_policy.c:2213 xfrm_policy_flush+0x331/0x460 net/xfrm/xfrm_policy.c:1789 xfrm_policy_fini+0xbf/0x640 net/xfrm/xfrm_policy.c:3866 xfrm_net_exit+0x1d/0x70 net/xfrm/xfrm_policy.c:3928 ops_exit_list.isra.0+0xb0/0x160 net/core/net_namespace.c:153 cleanup_net+0x51d/0xb10 net/core/net_namespace.c:551 process_one_work+0xd0c/0x1ce0 kernel/workqueue.c:2153 worker_thread+0x143/0x14a0 kernel/workqueue.c:2296 kthread+0x357/0x430 kernel/kthread.c:246 ret_from_fork+0x3a/0x50 arch/x86/entry/entry_64.S:352 Allocated by task 17676: save_stack+0x45/0xd0 mm/kasan/common.c:73 set_track mm/kasan/common.c:85 [inline] __kasan_kmalloc mm/kasan/common.c:496 [inline] __kasan_kmalloc.constprop.0+0xcf/0xe0 mm/kasan/common.c:469 kasan_kmalloc+0x9/0x10 mm/kasan/common.c:504 __do_kmalloc_node mm/slab.c:3673 [inline] __kmalloc_node_track_caller+0x4e/0x70 mm/slab.c:3687 __kmalloc_reserve.isra.0+0x40/0xe0 net/core/skbuff.c:140 pskb_expand_head+0x1f6/0x1080 net/core/skbuff.c:1465 __skb_cow include/linux/skbuff.h:2970 [inline] skb_cow_head include/linux/skbuff.h:3004 [inline] l2tp_xmit_skb+0x100b/0x1620 net/l2tp/l2tp_core.c:1069 pppol2tp_sendmsg+0x4a2/0x6b0 net/l2tp/l2tp_ppp.c:329 sock_sendmsg_nosec net/socket.c:621 [inline] sock_sendmsg+0xdd/0x130 net/socket.c:631 ___sys_sendmsg+0x409/0x910 net/socket.c:2116 __sys_sendmmsg+0x246/0x730 net/socket.c:2211 __do_sys_sendmmsg net/socket.c:2240 [inline] __se_sys_sendmmsg net/socket.c:2237 [inline] __x64_sys_sendmmsg+0x9d/0x100 net/socket.c:2237 do_syscall_64+0x1a3/0x800 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 17676: save_stack+0x45/0xd0 mm/kasan/common.c:73 set_track mm/kasan/common.c:85 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/common.c:458 kasan_slab_free+0xe/0x10 mm/kasan/common.c:466 __cache_free mm/slab.c:3487 [inline] kfree+0xcf/0x230 mm/slab.c:3806 skb_free_head+0x93/0xb0 net/core/skbuff.c:553 skb_release_data+0x6ea/0x970 net/core/skbuff.c:573 skb_release_all+0x4d/0x60 net/core/skbuff.c:627 __kfree_skb net/core/skbuff.c:641 [inline] consume_skb net/core/skbuff.c:701 [inline] consume_skb+0x18c/0x550 net/core/skbuff.c:695 ip6_xmit+0x19f5/0x24a0 net/ipv6/ip6_output.c:219 inet6_csk_xmit+0x358/0x650 net/ipv6/inet6_connection_sock.c:139 l2tp_xmit_core net/l2tp/l2tp_core.c:1030 [inline] l2tp_xmit_skb+0x12ff/0x1620 net/l2tp/l2tp_core.c:1132 pppol2tp_sendmsg+0x4a2/0x6b0 net/l2tp/l2tp_ppp.c:329 sock_sendmsg_nosec net/socket.c:621 [inline] sock_sendmsg+0xdd/0x130 net/socket.c:631 ___sys_sendmsg+0x409/0x910 net/socket.c:2116 __sys_sendmmsg+0x246/0x730 net/socket.c:2211 __do_sys_sendmmsg net/socket.c:2240 [inline] __se_sys_sendmmsg net/socket.c:2237 [inline] __x64_sys_sendmmsg+0x9d/0x100 net/socket.c:2237 do_syscall_64+0x1a3/0x800 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff888098256d80 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 936 bytes inside of 1024-byte region [ffff888098256d80, ffff888098257180) The buggy address belongs to the page: page:ffffea0002609580 count:1 mapcount:0 mapping:ffff88812c3f0ac0 index:0x0 compound_mapcount: 0 flags: 0x1fffc0000010200(slab|head) raw: 01fffc0000010200 ffffea0002260f08 ffffea0002301388 ffff88812c3f0ac0 raw: 0000000000000000 ffff888098256000 0000000100000007 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888098257000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888098257080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888098257100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888098257180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888098257200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================