================================================================== BUG: KASAN: use-after-free in __hlist_del include/linux/list.h:704 [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+0x9a4/0xa00 net/xfrm/xfrm_policy.c:2213 Write of size 8 at addr ffff8880996635b0 by task kworker/u4:9/15384 CPU: 1 PID: 15384 Comm: kworker/u4:9 Not tainted 5.0.0-rc3+ #24 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 __hlist_del include/linux/list.h:704 [inline] hlist_del_init include/linux/list.h:717 [inline] __xfrm_policy_unlink+0x9a4/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 3341: 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 __alloc_skb+0x12d/0x730 net/core/skbuff.c:208 alloc_skb include/linux/skbuff.h:1011 [inline] nlmsg_new include/net/netlink.h:654 [inline] inet6_rt_notify+0x101/0x2c0 net/ipv6/route.c:5032 fib6_add_rt2node+0x19d6/0x2840 net/ipv6/ip6_fib.c:1120 fib6_add+0xb7e/0x14e0 net/ipv6/ip6_fib.c:1337 __ip6_ins_rt+0x54/0x80 net/ipv6/route.c:1157 ip6_route_add+0x5a/0xd0 net/ipv6/route.c:3126 addrconf_prefix_route.isra.0+0x542/0x750 net/ipv6/addrconf.c:2397 fixup_permanent_addr net/ipv6/addrconf.c:3435 [inline] addrconf_permanent_addr net/ipv6/addrconf.c:3459 [inline] addrconf_notify+0x1a9f/0x25f0 net/ipv6/addrconf.c:3529 notifier_call_chain+0x179/0x380 kernel/notifier.c:93 __raw_notifier_call_chain kernel/notifier.c:394 [inline] raw_notifier_call_chain+0x2e/0x40 kernel/notifier.c:401 call_netdevice_notifiers_info+0x3f/0x90 net/core/dev.c:1739 call_netdevice_notifiers_extack net/core/dev.c:1751 [inline] call_netdevice_notifiers net/core/dev.c:1765 [inline] __dev_notify_flags+0x173/0x470 net/core/dev.c:7605 dev_change_flags+0x10d/0x170 net/core/dev.c:7643 do_setlink+0x17f5/0x3e10 net/core/rtnetlink.c:2492 __rtnl_newlink+0xd58/0x1a70 net/core/rtnetlink.c:3115 rtnl_newlink+0x69/0xa0 net/core/rtnetlink.c:3240 rtnetlink_rcv_msg+0x481/0xc30 net/core/rtnetlink.c:5198 netlink_rcv_skb+0x17d/0x410 net/netlink/af_netlink.c:2485 rtnetlink_rcv+0x1d/0x30 net/core/rtnetlink.c:5216 netlink_unicast_kernel net/netlink/af_netlink.c:1310 [inline] netlink_unicast+0x574/0x770 net/netlink/af_netlink.c:1336 netlink_sendmsg+0xa05/0xf90 net/netlink/af_netlink.c:1925 sock_sendmsg_nosec net/socket.c:621 [inline] sock_sendmsg+0xdd/0x130 net/socket.c:631 __sys_sendto+0x387/0x5f0 net/socket.c:1788 __do_sys_sendto net/socket.c:1800 [inline] __se_sys_sendto net/socket.c:1796 [inline] __x64_sys_sendto+0xe1/0x1a0 net/socket.c:1796 do_syscall_64+0x1a3/0x800 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 3341: 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 netlink_broadcast_filtered+0x6e7/0x16f0 net/netlink/af_netlink.c:1520 netlink_broadcast net/netlink/af_netlink.c:1542 [inline] nlmsg_multicast include/net/netlink.h:734 [inline] nlmsg_notify+0x93/0x1c0 net/netlink/af_netlink.c:2528 rtnl_notify+0xc5/0xf0 net/core/rtnetlink.c:742 inet6_rt_notify+0x204/0x2c0 net/ipv6/route.c:5044 fib6_add_rt2node+0x19d6/0x2840 net/ipv6/ip6_fib.c:1120 fib6_add+0xb7e/0x14e0 net/ipv6/ip6_fib.c:1337 __ip6_ins_rt+0x54/0x80 net/ipv6/route.c:1157 ip6_route_add+0x5a/0xd0 net/ipv6/route.c:3126 addrconf_prefix_route.isra.0+0x542/0x750 net/ipv6/addrconf.c:2397 fixup_permanent_addr net/ipv6/addrconf.c:3435 [inline] addrconf_permanent_addr net/ipv6/addrconf.c:3459 [inline] addrconf_notify+0x1a9f/0x25f0 net/ipv6/addrconf.c:3529 notifier_call_chain+0x179/0x380 kernel/notifier.c:93 __raw_notifier_call_chain kernel/notifier.c:394 [inline] raw_notifier_call_chain+0x2e/0x40 kernel/notifier.c:401 call_netdevice_notifiers_info+0x3f/0x90 net/core/dev.c:1739 call_netdevice_notifiers_extack net/core/dev.c:1751 [inline] call_netdevice_notifiers net/core/dev.c:1765 [inline] __dev_notify_flags+0x173/0x470 net/core/dev.c:7605 dev_change_flags+0x10d/0x170 net/core/dev.c:7643 do_setlink+0x17f5/0x3e10 net/core/rtnetlink.c:2492 __rtnl_newlink+0xd58/0x1a70 net/core/rtnetlink.c:3115 rtnl_newlink+0x69/0xa0 net/core/rtnetlink.c:3240 rtnetlink_rcv_msg+0x481/0xc30 net/core/rtnetlink.c:5198 netlink_rcv_skb+0x17d/0x410 net/netlink/af_netlink.c:2485 rtnetlink_rcv+0x1d/0x30 net/core/rtnetlink.c:5216 netlink_unicast_kernel net/netlink/af_netlink.c:1310 [inline] netlink_unicast+0x574/0x770 net/netlink/af_netlink.c:1336 netlink_sendmsg+0xa05/0xf90 net/netlink/af_netlink.c:1925 sock_sendmsg_nosec net/socket.c:621 [inline] sock_sendmsg+0xdd/0x130 net/socket.c:631 __sys_sendto+0x387/0x5f0 net/socket.c:1788 __do_sys_sendto net/socket.c:1800 [inline] __se_sys_sendto net/socket.c:1796 [inline] __x64_sys_sendto+0xe1/0x1a0 net/socket.c:1796 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 ffff888099663200 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 944 bytes inside of 1024-byte region [ffff888099663200, ffff888099663600) The buggy address belongs to the page: page:ffffea0002659880 count:1 mapcount:0 mapping:ffff88812c3f0ac0 index:0x0 compound_mapcount: 0 flags: 0x1fffc0000010200(slab|head) raw: 01fffc0000010200 ffffea0002148e08 ffffea000298f908 ffff88812c3f0ac0 raw: 0000000000000000 ffff888099662000 0000000100000007 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888099663480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888099663500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888099663580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888099663600: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888099663680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================