================================================================== BUG: KASAN: use-after-free in __read_once_size include/linux/compiler.h:183 [inline] BUG: KASAN: use-after-free in atomic_read arch/x86/include/asm/atomic.h:27 [inline] BUG: KASAN: use-after-free in refcount_inc_not_zero+0xd3/0xe0 lib/refcount.c:120 Read of size 4 at addr ffff888059eaf1c0 by task kworker/u4:6/27707 CPU: 1 PID: 27707 Comm: kworker/u4:6 Not tainted 4.14.152 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: l2tp l2tp_tunnel_del_work Call Trace: __dump_stack lib/dump_stack.c:17 [inline] dump_stack+0x138/0x197 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_load4_noabort+0x14/0x20 mm/kasan/report.c:429 __read_once_size include/linux/compiler.h:183 [inline] atomic_read arch/x86/include/asm/atomic.h:27 [inline] refcount_inc_not_zero+0xd3/0xe0 lib/refcount.c:120 refcount_inc+0x16/0x40 lib/refcount.c:153 sock_hold include/net/sock.h:619 [inline] pppol2tp_session_sock_hold+0x48/0x60 net/l2tp/l2tp_ppp.c:263 l2tp_tunnel_closeall+0x1ef/0x380 net/l2tp/l2tp_core.c:1332 l2tp_tunnel_del_work+0x64/0x410 net/l2tp/l2tp_core.c:1380 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 Allocated by task 29470: 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_node mm/slab.c:3682 [inline] __kmalloc_node_track_caller+0x51/0x80 mm/slab.c:3696 __kmalloc_reserve.isra.0+0x40/0xe0 net/core/skbuff.c:137 pskb_expand_head+0x116/0xc10 net/core/skbuff.c:1462 netlink_trim+0x1c1/0x230 net/netlink/af_netlink.c:1268 netlink_broadcast_filtered+0x5c/0x9f0 net/netlink/af_netlink.c:1465 netlink_broadcast net/netlink/af_netlink.c:1510 [inline] nlmsg_multicast include/net/netlink.h:591 [inline] nlmsg_notify+0x7c/0x190 net/netlink/af_netlink.c:2475 rtnl_notify net/core/rtnetlink.c:653 [inline] rtmsg_ifinfo_send net/core/rtnetlink.c:2900 [inline] rtmsg_ifinfo_event.part.0+0xa1/0xc0 net/core/rtnetlink.c:2914 rtmsg_ifinfo_event net/core/rtnetlink.c:2921 [inline] rtmsg_ifinfo+0x6f/0x90 net/core/rtnetlink.c:2920 __dev_notify_flags+0x1c9/0x240 net/core/dev.c:6830 dev_change_flags+0xf7/0x140 net/core/dev.c:6867 do_setlink+0x929/0x2d50 net/core/rtnetlink.c:2071 rtnl_newlink+0x11a7/0x1700 net/core/rtnetlink.c:2630 rtnetlink_rcv_msg+0x3eb/0xb70 net/core/rtnetlink.c:4285 netlink_rcv_skb+0x14f/0x3c0 net/netlink/af_netlink.c:2432 rtnetlink_rcv+0x1d/0x30 net/core/rtnetlink.c:4297 netlink_unicast_kernel net/netlink/af_netlink.c:1286 [inline] netlink_unicast+0x45d/0x640 net/netlink/af_netlink.c:1312 netlink_sendmsg+0x7c4/0xc60 net/netlink/af_netlink.c:1877 sock_sendmsg_nosec net/socket.c:646 [inline] sock_sendmsg+0xce/0x110 net/socket.c:656 SYSC_sendto+0x206/0x310 net/socket.c:1763 SyS_sendto+0x40/0x50 net/socket.c:1731 do_syscall_64+0x1e8/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x42/0xb7 Freed by task 29470: 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 skb_free_head+0x8b/0xb0 net/core/skbuff.c:554 skb_release_data+0x4af/0x700 net/core/skbuff.c:574 skb_release_all+0x4d/0x60 net/core/skbuff.c:631 __kfree_skb net/core/skbuff.c:645 [inline] consume_skb+0xaf/0x340 net/core/skbuff.c:705 netlink_broadcast_filtered+0x2ae/0x9f0 net/netlink/af_netlink.c:1488 netlink_broadcast net/netlink/af_netlink.c:1510 [inline] nlmsg_multicast include/net/netlink.h:591 [inline] nlmsg_notify+0x7c/0x190 net/netlink/af_netlink.c:2475 rtnl_notify net/core/rtnetlink.c:653 [inline] rtmsg_ifinfo_send net/core/rtnetlink.c:2900 [inline] rtmsg_ifinfo_event.part.0+0xa1/0xc0 net/core/rtnetlink.c:2914 rtmsg_ifinfo_event net/core/rtnetlink.c:2921 [inline] rtmsg_ifinfo+0x6f/0x90 net/core/rtnetlink.c:2920 __dev_notify_flags+0x1c9/0x240 net/core/dev.c:6830 dev_change_flags+0xf7/0x140 net/core/dev.c:6867 do_setlink+0x929/0x2d50 net/core/rtnetlink.c:2071 rtnl_newlink+0x11a7/0x1700 net/core/rtnetlink.c:2630 rtnetlink_rcv_msg+0x3eb/0xb70 net/core/rtnetlink.c:4285 netlink_rcv_skb+0x14f/0x3c0 net/netlink/af_netlink.c:2432 rtnetlink_rcv+0x1d/0x30 net/core/rtnetlink.c:4297 netlink_unicast_kernel net/netlink/af_netlink.c:1286 [inline] netlink_unicast+0x45d/0x640 net/netlink/af_netlink.c:1312 netlink_sendmsg+0x7c4/0xc60 net/netlink/af_netlink.c:1877 sock_sendmsg_nosec net/socket.c:646 [inline] sock_sendmsg+0xce/0x110 net/socket.c:656 SYSC_sendto+0x206/0x310 net/socket.c:1763 SyS_sendto+0x40/0x50 net/socket.c:1731 do_syscall_64+0x1e8/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x42/0xb7 The buggy address belongs to the object at ffff888059eaf140 which belongs to the cache kmalloc-2048 of size 2048 The buggy address is located 128 bytes inside of 2048-byte region [ffff888059eaf140, ffff888059eaf940) The buggy address belongs to the page: page:ffffea000167ab80 count:1 mapcount:0 mapping:ffff888059eae040 index:0x0 compound_mapcount: 0 flags: 0x1fffc0000008100(slab|head) raw: 01fffc0000008100 ffff888059eae040 0000000000000000 0000000100000003 raw: ffffea00015037a0 ffffea000262eaa0 ffff8880aa800c40 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888059eaf080: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff888059eaf100: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb >ffff888059eaf180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888059eaf200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888059eaf280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================