================================================================== BUG: KASAN: use-after-free in __read_once_size include/linux/compiler.h:183 [inline] BUG: KASAN: use-after-free in dev_queue_xmit_nit+0x7cb/0x940 net/core/dev.c:1929 Read of size 8 at addr ffff888061ce5668 by task syz-executor.1/24438 CPU: 0 PID: 24438 Comm: syz-executor.1 Not tainted 4.14.136 #32 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:17 [inline] dump_stack+0x138/0x19c 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_load8_noabort+0x14/0x20 mm/kasan/report.c:430 __read_once_size include/linux/compiler.h:183 [inline] dev_queue_xmit_nit+0x7cb/0x940 net/core/dev.c:1929 xmit_one net/core/dev.c:3005 [inline] dev_hard_start_xmit+0xa7/0x8b0 net/core/dev.c:3025 sch_direct_xmit+0x27a/0x550 net/sched/sch_generic.c:186 __dev_xmit_skb net/core/dev.c:3218 [inline] __dev_queue_xmit+0x1b6e/0x25e0 net/core/dev.c:3493 dev_queue_xmit+0x18/0x20 net/core/dev.c:3558 neigh_hh_output include/net/neighbour.h:490 [inline] neigh_output include/net/neighbour.h:498 [inline] ip_finish_output2+0xddc/0x14a0 net/ipv4/ip_output.c:229 ip_finish_output+0x56d/0xc60 net/ipv4/ip_output.c:317 NF_HOOK_COND include/linux/netfilter.h:239 [inline] ip_output+0x1e6/0x590 net/ipv4/ip_output.c:405 dst_output include/net/dst.h:462 [inline] ip_local_out+0x97/0x170 net/ipv4/ip_output.c:124 ip_queue_xmit+0x7d7/0x1b10 net/ipv4/ip_output.c:504 __tcp_transmit_skb+0x172c/0x2fe0 net/ipv4/tcp_output.c:1130 __tcp_send_ack.part.0+0x3c8/0x5b0 net/ipv4/tcp_output.c:3621 __tcp_send_ack net/ipv4/tcp_output.c:3627 [inline] tcp_send_ack+0x7a/0xa0 net/ipv4/tcp_output.c:3627 __tcp_ack_snd_check+0x107/0x3a0 net/ipv4/tcp_input.c:5141 tcp_rcv_established+0x1179/0x1650 net/ipv4/tcp_input.c:5531 tcp_v4_do_rcv+0x563/0x7e0 net/ipv4/tcp_ipv4.c:1467 tcp_v4_rcv+0x241e/0x3170 net/ipv4/tcp_ipv4.c:1741 ip_local_deliver_finish+0x25e/0xad0 net/ipv4/ip_input.c:216 NF_HOOK include/linux/netfilter.h:250 [inline] NF_HOOK include/linux/netfilter.h:244 [inline] ip_local_deliver+0x1c3/0x4a0 net/ipv4/ip_input.c:257 dst_input include/net/dst.h:468 [inline] ip_rcv_finish+0x7be/0x1a50 net/ipv4/ip_input.c:396 NF_HOOK include/linux/netfilter.h:250 [inline] NF_HOOK include/linux/netfilter.h:244 [inline] ip_rcv+0xaa5/0x112b net/ipv4/ip_input.c:493 __netif_receive_skb_core+0x1eae/0x2ca0 net/core/dev.c:4477 __netif_receive_skb+0x2c/0x1b0 net/core/dev.c:4515 netif_receive_skb_internal+0xe4/0x5a0 net/core/dev.c:4588 napi_skb_finish net/core/dev.c:4949 [inline] napi_gro_receive+0x2f8/0x410 net/core/dev.c:4980 receive_buf+0x532/0x3fc0 drivers/net/virtio_net.c:852 virtnet_receive drivers/net/virtio_net.c:1098 [inline] virtnet_poll+0x515/0xa6e drivers/net/virtio_net.c:1189 napi_poll net/core/dev.c:5598 [inline] net_rx_action+0x490/0xf80 net/core/dev.c:5664 __do_softirq+0x244/0x9a0 kernel/softirq.c:288 invoke_softirq kernel/softirq.c:368 [inline] irq_exit+0x160/0x1b0 kernel/softirq.c:409 exiting_irq arch/x86/include/asm/apic.h:648 [inline] do_IRQ+0x11b/0x1d0 arch/x86/kernel/irq.c:242 common_interrupt+0x8e/0x8e arch/x86/entry/entry_64.S:573 RIP: 0010:arch_local_irq_restore arch/x86/include/asm/paravirt.h:778 [inline] RIP: 0010:__raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:160 [inline] RIP: 0010:_raw_spin_unlock_irqrestore+0x95/0xe0 kernel/locking/spinlock.c:192 RSP: 0018:ffff8880946d7458 EFLAGS: 00000286 ORIG_RAX: ffffffffffffff6e RAX: 1ffffffff0ee2a39 RBX: 0000000000000286 RCX: 1ffff1100c7d91e6 RDX: dffffc0000000000 RSI: ffff888063ec8f38 RDI: 0000000000000286 RBP: ffff8880946d7468 R08: ffff888063ec8640 R09: ffff888063ec8f30 R10: 0000000000000000 R11: 0000000000000000 R12: ffffffff87791840 R13: 0000000000000286 R14: ffff888063ec89d8 R15: ffffffff877918e8 rcu_report_unblock_qs_rnp.constprop.0+0xac/0x1e0 kernel/rcu/tree.c:2478 rcu_read_unlock_special+0x895/0xd40 kernel/rcu/tree_plugin.h:526 __rcu_read_unlock+0x161/0x170 kernel/rcu/update.c:260 rcu_read_unlock include/linux/rcupdate.h:684 [inline] is_bpf_text_address+0x89/0x120 kernel/bpf/core.c:454 kernel_text_address+0x73/0xf0 kernel/extable.c:150 __kernel_text_address+0xd/0x40 kernel/extable.c:105 unwind_get_return_address arch/x86/kernel/unwind_frame.c:18 [inline] unwind_get_return_address+0x61/0xa0 arch/x86/kernel/unwind_frame.c:13 __save_stack_trace+0x7b/0xd0 arch/x86/kernel/stacktrace.c:45 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 kmem_cache_alloc_node_trace+0x153/0x770 mm/slab.c:3661 __do_kmalloc_node mm/slab.c:3681 [inline] __kmalloc_node_track_caller+0x3d/0x80 mm/slab.c:3696 __kmalloc_reserve.isra.0+0x40/0xe0 net/core/skbuff.c:137 __alloc_skb+0xcf/0x500 net/core/skbuff.c:205 alloc_skb include/linux/skbuff.h:980 [inline] kobject_uevent_env+0x781/0xc23 lib/kobject_uevent.c:479 kobject_uevent+0x20/0x26 lib/kobject_uevent.c:553 netdev_queue_add_kobject net/core/net-sysfs.c:1341 [inline] netdev_queue_update_kobjects+0x295/0x360 net/core/net-sysfs.c:1355 register_queue_kobjects net/core/net-sysfs.c:1397 [inline] netdev_register_kobject+0x28a/0x3a0 net/core/net-sysfs.c:1603 register_netdevice+0x814/0xca0 net/core/dev.c:7668 register_netdev+0x1b/0x30 net/core/dev.c:7785 loopback_net_init+0x78/0x150 drivers/net/loopback.c:214 ops_init+0xa9/0x3d0 net/core/net_namespace.c:118 setup_net+0x237/0x530 net/core/net_namespace.c:295 copy_net_ns+0x19f/0x440 net/core/net_namespace.c:419 create_new_namespaces+0x37b/0x720 kernel/nsproxy.c:107 unshare_nsproxy_namespaces+0xab/0x1e0 kernel/nsproxy.c:206 SYSC_unshare kernel/fork.c:2406 [inline] SyS_unshare+0x2f3/0x7e0 kernel/fork.c:2356 do_syscall_64+0x1e8/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x42/0xb7 RIP: 0033:0x459829 RSP: 002b:00007f66df409c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000110 RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 0000000000459829 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000040000000 RBP: 000000000075bf20 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f66df40a6d4 R13: 00000000004c8f3a R14: 00000000004dfff0 R15: 00000000ffffffff Allocated by task 24470: 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 mm/slab.c:3720 [inline] __kmalloc+0x15d/0x7a0 mm/slab.c:3729 kmalloc include/linux/slab.h:493 [inline] sk_prot_alloc+0x171/0x2a0 net/core/sock.c:1467 sk_alloc+0x39/0xd70 net/core/sock.c:1521 packet_create+0xfa/0x820 net/packet/af_packet.c:3257 __sock_create+0x2f6/0x620 net/socket.c:1275 sock_create net/socket.c:1315 [inline] SYSC_socket net/socket.c:1345 [inline] SyS_socket+0xd3/0x170 net/socket.c:1325 do_syscall_64+0x1e8/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x42/0xb7 Freed by task 24470: 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 sk_prot_free net/core/sock.c:1504 [inline] __sk_destruct+0x493/0x5d0 net/core/sock.c:1583 sk_destruct+0x67/0x80 net/core/sock.c:1591 __sk_free+0x54/0x230 net/core/sock.c:1599 sk_free+0x35/0x40 net/core/sock.c:1610 sock_put include/net/sock.h:1653 [inline] packet_release+0x8ba/0xb50 net/packet/af_packet.c:3086 __sock_release+0xce/0x2b0 net/socket.c:602 sock_close+0x1b/0x30 net/socket.c:1139 __fput+0x275/0x7a0 fs/file_table.c:210 ____fput+0x16/0x20 fs/file_table.c:244 task_work_run+0x114/0x190 kernel/task_work.c:113 exit_task_work include/linux/task_work.h:22 [inline] do_exit+0x7df/0x2c10 kernel/exit.c:874 do_group_exit+0x111/0x330 kernel/exit.c:977 get_signal+0x381/0x1cd0 kernel/signal.c:2409 do_signal+0x86/0x19a0 arch/x86/kernel/signal.c:814 exit_to_usermode_loop+0x15c/0x220 arch/x86/entry/common.c:160 prepare_exit_to_usermode arch/x86/entry/common.c:199 [inline] syscall_return_slowpath arch/x86/entry/common.c:270 [inline] do_syscall_64+0x4bc/0x640 arch/x86/entry/common.c:297 entry_SYSCALL_64_after_hwframe+0x42/0xb7 The buggy address belongs to the object at ffff888061ce4e80 which belongs to the cache kmalloc-2048 of size 2048 The buggy address is located 2024 bytes inside of 2048-byte region [ffff888061ce4e80, ffff888061ce5680) The buggy address belongs to the page: page:ffffea0001873900 count:1 mapcount:0 mapping:ffff888061ce4600 index:0xffff888061ce5700 compound_mapcount: 0 flags: 0x1fffc0000008100(slab|head) raw: 01fffc0000008100 ffff888061ce4600 ffff888061ce5700 0000000100000002 raw: ffffea00025f6420 ffffea00026f97a0 ffff8880aa800c40 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888061ce5500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888061ce5580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888061ce5600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888061ce5680: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888061ce5700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================