================================================================== BUG: KASAN: use-after-free in __read_once_size include/linux/compiler.h:193 [inline] BUG: KASAN: use-after-free in dev_queue_xmit_nit+0x87e/0xa20 net/core/dev.c:2004 Read of size 8 at addr ffff8880b4bf5c30 by task syz-executor.3/22284 CPU: 1 PID: 22284 Comm: syz-executor.3 Not tainted 4.19.152-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1fc/0x2fe lib/dump_stack.c:118 print_address_description.cold+0x54/0x219 mm/kasan/report.c:256 kasan_report_error.cold+0x8a/0x1c7 mm/kasan/report.c:354 kasan_report mm/kasan/report.c:412 [inline] __asan_report_load8_noabort+0x88/0x90 mm/kasan/report.c:433 __read_once_size include/linux/compiler.h:193 [inline] dev_queue_xmit_nit+0x87e/0xa20 net/core/dev.c:2004 xmit_one net/core/dev.c:3252 [inline] dev_hard_start_xmit+0xaa/0x920 net/core/dev.c:3272 sch_direct_xmit+0x2d6/0xf50 net/sched/sch_generic.c:332 qdisc_restart net/sched/sch_generic.c:395 [inline] __qdisc_run+0x4d0/0x1640 net/sched/sch_generic.c:403 qdisc_run include/net/pkt_sched.h:120 [inline] __dev_xmit_skb net/core/dev.c:3451 [inline] __dev_queue_xmit+0x2102/0x2e00 net/core/dev.c:3807 neigh_hh_output include/net/neighbour.h:491 [inline] neigh_output include/net/neighbour.h:499 [inline] ip_finish_output2+0xb6d/0x15a0 net/ipv4/ip_output.c:230 ip_finish_output+0x84d/0xcd0 net/ipv4/ip_output.c:318 NF_HOOK_COND include/linux/netfilter.h:278 [inline] ip_output+0x203/0x5f0 net/ipv4/ip_output.c:406 dst_output include/net/dst.h:455 [inline] ip_local_out+0xaf/0x170 net/ipv4/ip_output.c:125 __ip_queue_xmit+0x866/0x1b50 net/ipv4/ip_output.c:506 __tcp_transmit_skb+0x1bb2/0x33f0 net/ipv4/tcp_output.c:1148 tcp_transmit_skb net/ipv4/tcp_output.c:1164 [inline] tcp_write_xmit+0x968/0x4fb0 net/ipv4/tcp_output.c:2389 __tcp_push_pending_frames+0xae/0x310 net/ipv4/tcp_output.c:2568 tcp_push_pending_frames include/net/tcp.h:1772 [inline] tcp_data_snd_check net/ipv4/tcp_input.c:5179 [inline] tcp_rcv_established+0x1450/0x1e20 net/ipv4/tcp_input.c:5588 tcp_v4_do_rcv+0x5d6/0x870 net/ipv4/tcp_ipv4.c:1544 tcp_v4_rcv+0x2c03/0x3b80 net/ipv4/tcp_ipv4.c:1829 ip_local_deliver_finish+0x495/0xc00 net/ipv4/ip_input.c:215 NF_HOOK include/linux/netfilter.h:289 [inline] ip_local_deliver+0x188/0x500 net/ipv4/ip_input.c:256 dst_input include/net/dst.h:461 [inline] ip_rcv_finish+0x1ca/0x2e0 net/ipv4/ip_input.c:414 NF_HOOK include/linux/netfilter.h:289 [inline] ip_rcv+0xca/0x3c0 net/ipv4/ip_input.c:524 __netif_receive_skb_one_core+0x114/0x180 net/core/dev.c:4954 __netif_receive_skb+0x27/0x1c0 net/core/dev.c:5066 netif_receive_skb_internal+0xf0/0x3f0 net/core/dev.c:5156 napi_skb_finish net/core/dev.c:5600 [inline] napi_gro_receive+0x2e6/0x450 net/core/dev.c:5631 receive_buf+0xf1d/0x6120 drivers/net/virtio_net.c:1072 virtnet_receive drivers/net/virtio_net.c:1336 [inline] virtnet_poll+0x568/0xd70 drivers/net/virtio_net.c:1441 napi_poll net/core/dev.c:6272 [inline] net_rx_action+0x4ac/0xfb0 net/core/dev.c:6338 __do_softirq+0x26c/0x9a0 kernel/softirq.c:292 invoke_softirq kernel/softirq.c:372 [inline] irq_exit+0x215/0x260 kernel/softirq.c:412 exiting_irq arch/x86/include/asm/apic.h:544 [inline] smp_apic_timer_interrupt+0x136/0x550 arch/x86/kernel/apic/apic.c:1094 apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:894 RIP: 0010:arch_local_irq_restore arch/x86/include/asm/paravirt.h:789 [inline] RIP: 0010:lock_is_held_type+0x17a/0x210 kernel/locking/lockdep.c:3947 Code: 00 00 00 00 fc ff df c7 85 84 08 00 00 00 00 00 00 48 c1 e8 03 80 3c 10 00 75 63 48 83 3d 25 82 a5 08 00 74 2c 48 89 df 57 9d <0f> 1f 44 00 00 48 83 c4 08 44 89 e0 5b 5d 41 5c c3 48 83 c4 08 41 RSP: 0018:ffff88805e4b76b8 EFLAGS: 00000282 ORIG_RAX: ffffffffffffff13 RAX: 1ffffffff13e2fe9 RBX: 0000000000000282 RCX: 0000000000000001 RDX: dffffc0000000000 RSI: 00000000ffffffff RDI: 0000000000000282 RBP: ffff88809437c300 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000005 R11: 0000000000000000 R12: 0000000000000000 R13: 000000000002b000 R14: ffff88805e4b0000 R15: ffff8880ba12b000 lock_is_held include/linux/lockdep.h:344 [inline] schedule_debug kernel/sched/core.c:3337 [inline] __schedule+0xf7f/0x2040 kernel/sched/core.c:3439 preempt_schedule_common+0x45/0xc0 kernel/sched/core.c:3641 ___preempt_schedule+0x16/0x18 __raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:161 [inline] _raw_spin_unlock_irqrestore+0xaf/0xe0 kernel/locking/spinlock.c:184 __rcu_read_unlock+0x158/0x160 kernel/rcu/tree_plugin.h:428 rcu_read_unlock include/linux/rcupdate.h:680 [inline] nf_hook include/linux/netfilter.h:246 [inline] NF_HOOK include/linux/netfilter.h:287 [inline] ip_mc_output+0xbbc/0xec0 net/ipv4/ip_output.c:370 dst_output include/net/dst.h:455 [inline] ip_local_out+0xaf/0x170 net/ipv4/ip_output.c:125 ip_send_skb+0x3e/0xe0 net/ipv4/ip_output.c:1447 udp_send_skb+0x6a4/0x1170 net/ipv4/udp.c:848 udp_push_pending_frames net/ipv4/udp.c:876 [inline] udp_sendpage+0x38f/0x5c0 net/ipv4/udp.c:1247 inet_sendpage+0x164/0x650 net/ipv4/af_inet.c:815 kernel_sendpage net/socket.c:3378 [inline] sock_sendpage+0xdf/0x140 net/socket.c:847 pipe_to_sendpage+0x268/0x330 fs/splice.c:452 splice_from_pipe_feed fs/splice.c:503 [inline] __splice_from_pipe+0x389/0x800 fs/splice.c:627 splice_from_pipe fs/splice.c:662 [inline] generic_splice_sendpage+0xd4/0x140 fs/splice.c:833 do_splice_from fs/splice.c:852 [inline] do_splice fs/splice.c:1154 [inline] __do_sys_splice fs/splice.c:1428 [inline] __se_sys_splice+0xfe7/0x16d0 fs/splice.c:1408 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x45de59 Code: 0d b4 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 0f 83 db b3 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007f7b5a0a1c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000113 RAX: ffffffffffffffda RBX: 0000000000035140 RCX: 000000000045de59 RDX: 0000000000000007 RSI: 0000000000000000 RDI: 0000000000000003 RBP: 000000000118c020 R08: 000000000003001a R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000118bfd4 R13: 00007fffebb0727f R14: 00007f7b5a0a29c0 R15: 000000000118bfd4 Allocated by task 22304: __do_kmalloc mm/slab.c:3727 [inline] __kmalloc+0x15a/0x3c0 mm/slab.c:3736 kmalloc include/linux/slab.h:520 [inline] sk_prot_alloc+0x1e2/0x2d0 net/core/sock.c:1466 sk_alloc+0x36/0xec0 net/core/sock.c:1520 packet_create+0x117/0x850 net/packet/af_packet.c:3259 __sock_create+0x3d8/0x740 net/socket.c:1276 sock_create net/socket.c:1316 [inline] __sys_socket+0xef/0x200 net/socket.c:1346 __do_sys_socket net/socket.c:1355 [inline] __se_sys_socket net/socket.c:1353 [inline] __x64_sys_socket+0x6f/0xb0 net/socket.c:1353 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 22298: __cache_free mm/slab.c:3503 [inline] kfree+0xcc/0x210 mm/slab.c:3822 sk_prot_free net/core/sock.c:1503 [inline] __sk_destruct+0x684/0x8a0 net/core/sock.c:1584 sk_destruct net/core/sock.c:1599 [inline] __sk_free+0x165/0x3b0 net/core/sock.c:1610 sk_free+0x3b/0x50 net/core/sock.c:1621 sock_put include/net/sock.h:1711 [inline] packet_release+0x890/0xb70 net/packet/af_packet.c:3088 __sock_release+0xcd/0x2a0 net/socket.c:579 sock_close+0x15/0x20 net/socket.c:1140 __fput+0x2ce/0x890 fs/file_table.c:278 task_work_run+0x148/0x1c0 kernel/task_work.c:113 tracehook_notify_resume include/linux/tracehook.h:193 [inline] exit_to_usermode_loop+0x251/0x2a0 arch/x86/entry/common.c:167 prepare_exit_to_usermode arch/x86/entry/common.c:198 [inline] syscall_return_slowpath arch/x86/entry/common.c:271 [inline] do_syscall_64+0x538/0x620 arch/x86/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff8880b4bf5440 which belongs to the cache kmalloc-2048 of size 2048 The buggy address is located 2032 bytes inside of 2048-byte region [ffff8880b4bf5440, ffff8880b4bf5c40) The buggy address belongs to the page: page:ffffea0002d2fd00 count:1 mapcount:0 mapping:ffff88813bff0c40 index:0xffff8880b4bf4bc0 compound_mapcount: 0 flags: 0xfff00000008100(slab|head) raw: 00fff00000008100 ffffea0001a80988 ffffea00025cdc88 ffff88813bff0c40 raw: ffff8880b4bf4bc0 ffff8880b4bf4340 0000000100000001 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880b4bf5b00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880b4bf5b80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8880b4bf5c00: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ^ ffff8880b4bf5c80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8880b4bf5d00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================