================================================================== BUG: KASAN: use-after-free in skb_loop_sk net/core/dev.c:1892 [inline] BUG: KASAN: use-after-free in dev_queue_xmit_nit+0xb6d/0xc40 net/core/dev.c:1921 Read of size 8 at addr ffff8801c8587a20 by task kworker/1:2/1370 CPU: 1 PID: 1370 Comm: kworker/1:2 Not tainted 4.14.0-mm1+ #25 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: ipv6_addrconf addrconf_dad_work Call Trace: __dump_stack lib/dump_stack.c:17 [inline] dump_stack+0x194/0x257 lib/dump_stack.c:53 print_address_description+0x73/0x250 mm/kasan/report.c:252 kasan_report_error mm/kasan/report.c:351 [inline] kasan_report+0x25b/0x340 mm/kasan/report.c:409 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:430 skb_loop_sk net/core/dev.c:1892 [inline] dev_queue_xmit_nit+0xb6d/0xc40 net/core/dev.c:1921 xmit_one net/core/dev.c:2986 [inline] dev_hard_start_xmit+0x16b/0xac0 net/core/dev.c:3006 __dev_queue_xmit+0x17d2/0x2070 net/core/dev.c:3487 dev_queue_xmit+0x17/0x20 net/core/dev.c:3520 vlan_dev_hard_start_xmit+0x36a/0x7b0 net/8021q/vlan_dev.c:130 __netdev_start_xmit include/linux/netdevice.h:4042 [inline] netdev_start_xmit include/linux/netdevice.h:4051 [inline] xmit_one net/core/dev.c:2990 [inline] dev_hard_start_xmit+0x248/0xac0 net/core/dev.c:3006 __dev_queue_xmit+0x17d2/0x2070 net/core/dev.c:3487 dev_queue_xmit+0x17/0x20 net/core/dev.c:3520 neigh_connected_output+0x489/0x720 net/core/neighbour.c:1379 neigh_output include/net/neighbour.h:482 [inline] ip6_finish_output2+0xad1/0x2310 net/ipv6/ip6_output.c:120 ip6_finish_output+0x2f9/0x920 net/ipv6/ip6_output.c:146 NF_HOOK_COND include/linux/netfilter.h:239 [inline] ip6_output+0x1eb/0x840 net/ipv6/ip6_output.c:163 dst_output include/net/dst.h:460 [inline] NF_HOOK include/linux/netfilter.h:250 [inline] ndisc_send_skb+0xab3/0x1350 net/ipv6/ndisc.c:491 ndisc_send_ns+0x393/0x860 net/ipv6/ndisc.c:628 addrconf_dad_work+0x9ea/0x10b0 net/ipv6/addrconf.c:3993 process_one_work+0xbfd/0x1be0 kernel/workqueue.c:2112 worker_thread+0x223/0x1990 kernel/workqueue.c:2246 kthread+0x37a/0x440 kernel/kthread.c:238 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:437 Allocated by task 6839: save_stack+0x43/0xd0 mm/kasan/kasan.c:447 set_track mm/kasan/kasan.c:459 [inline] kasan_kmalloc+0xad/0xe0 mm/kasan/kasan.c:551 __do_kmalloc mm/slab.c:3712 [inline] __kmalloc+0x162/0x760 mm/slab.c:3721 kmalloc include/linux/slab.h:519 [inline] sk_prot_alloc+0x101/0x2a0 net/core/sock.c:1469 sk_alloc+0x89/0x700 net/core/sock.c:1523 packet_create+0x169/0xb00 net/packet/af_packet.c:3213 __sock_create+0x4d4/0x850 net/socket.c:1261 sock_create net/socket.c:1301 [inline] SYSC_socket net/socket.c:1331 [inline] SyS_socket+0xeb/0x200 net/socket.c:1311 entry_SYSCALL_64_fastpath+0x1f/0x96 Freed by task 6841: save_stack+0x43/0xd0 mm/kasan/kasan.c:447 set_track mm/kasan/kasan.c:459 [inline] kasan_slab_free+0x71/0xc0 mm/kasan/kasan.c:524 __cache_free mm/slab.c:3492 [inline] kfree+0xca/0x250 mm/slab.c:3807 sk_prot_free net/core/sock.c:1506 [inline] __sk_destruct+0x74a/0x910 net/core/sock.c:1585 sk_destruct+0x47/0x80 net/core/sock.c:1593 __sk_free+0x57/0x230 net/core/sock.c:1601 sk_free+0x2a/0x40 net/core/sock.c:1612 sock_put include/net/sock.h:1657 [inline] packet_release+0x883/0xde0 net/packet/af_packet.c:3047 sock_release+0x8d/0x1e0 net/socket.c:596 sock_close+0x16/0x20 net/socket.c:1125 __fput+0x333/0x7f0 fs/file_table.c:210 ____fput+0x15/0x20 fs/file_table.c:244 task_work_run+0x199/0x270 kernel/task_work.c:113 exit_task_work include/linux/task_work.h:22 [inline] do_exit+0x9bb/0x1ae0 kernel/exit.c:869 do_group_exit+0x149/0x400 kernel/exit.c:972 get_signal+0x73f/0x16c0 kernel/signal.c:2335 do_signal+0x94/0x1ee0 arch/x86/kernel/signal.c:809 exit_to_usermode_loop+0x214/0x310 arch/x86/entry/common.c:158 prepare_exit_to_usermode arch/x86/entry/common.c:195 [inline] syscall_return_slowpath+0x490/0x550 arch/x86/entry/common.c:264 entry_SYSCALL_64_fastpath+0x94/0x96 The buggy address belongs to the object at ffff8801c8587240 which belongs to the cache kmalloc-2048 of size 2048 The buggy address is located 2016 bytes inside of 2048-byte region [ffff8801c8587240, ffff8801c8587a40) The buggy address belongs to the page: page:ffffea0007216180 count:1 mapcount:0 mapping:ffff8801c8586140 index:0x0 compound_mapcount: 0 flags: 0x2fffc0000008100(slab|head) raw: 02fffc0000008100 ffff8801c8586140 0000000000000000 0000000100000003 raw: ffffea00072cea20 ffffea00070bb220 ffff8801db000c40 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8801c8587900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8801c8587980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8801c8587a00: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ^ ffff8801c8587a80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8801c8587b00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================