================================================================== BUG: KASAN: use-after-free in __read_once_size syzkaller/managers/linux-4-19/kernel/./include/linux/compiler.h:207 [inline] BUG: KASAN: use-after-free in dev_queue_xmit_nit+0x87e/0xa20 syzkaller/managers/linux-4-19/kernel/net/core/dev.c:2004 Read of size 8 at addr ffff8880aaf5f530 by task syz-executor.4/23544 CPU: 1 PID: 23544 Comm: syz-executor.4 Not tainted 4.19.172-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack syzkaller/managers/linux-4-19/kernel/lib/dump_stack.c:77 [inline] dump_stack+0x1fc/0x2ef syzkaller/managers/linux-4-19/kernel/lib/dump_stack.c:118 print_address_description.cold+0x54/0x219 syzkaller/managers/linux-4-19/kernel/mm/kasan/report.c:256 kasan_report_error.cold+0x8a/0x1b9 syzkaller/managers/linux-4-19/kernel/mm/kasan/report.c:354 kasan_report syzkaller/managers/linux-4-19/kernel/mm/kasan/report.c:412 [inline] __asan_report_load8_noabort+0x88/0x90 syzkaller/managers/linux-4-19/kernel/mm/kasan/report.c:433 __read_once_size syzkaller/managers/linux-4-19/kernel/./include/linux/compiler.h:207 [inline] dev_queue_xmit_nit+0x87e/0xa20 syzkaller/managers/linux-4-19/kernel/net/core/dev.c:2004 xmit_one syzkaller/managers/linux-4-19/kernel/net/core/dev.c:3252 [inline] dev_hard_start_xmit+0xaa/0x920 syzkaller/managers/linux-4-19/kernel/net/core/dev.c:3272 sch_direct_xmit+0x2d6/0xf50 syzkaller/managers/linux-4-19/kernel/net/sched/sch_generic.c:332 qdisc_restart syzkaller/managers/linux-4-19/kernel/net/sched/sch_generic.c:395 [inline] __qdisc_run+0x4d0/0x1640 syzkaller/managers/linux-4-19/kernel/net/sched/sch_generic.c:403 qdisc_run syzkaller/managers/linux-4-19/kernel/./include/net/pkt_sched.h:120 [inline] __dev_xmit_skb syzkaller/managers/linux-4-19/kernel/net/core/dev.c:3451 [inline] __dev_queue_xmit+0x2102/0x2e00 syzkaller/managers/linux-4-19/kernel/net/core/dev.c:3807 neigh_hh_output syzkaller/managers/linux-4-19/kernel/./include/net/neighbour.h:491 [inline] neigh_output syzkaller/managers/linux-4-19/kernel/./include/net/neighbour.h:499 [inline] ip_finish_output2+0xb6d/0x15a0 syzkaller/managers/linux-4-19/kernel/net/ipv4/ip_output.c:230 ip_finish_output+0x858/0xd20 syzkaller/managers/linux-4-19/kernel/net/ipv4/ip_output.c:318 NF_HOOK_COND syzkaller/managers/linux-4-19/kernel/./include/linux/netfilter.h:278 [inline] ip_output+0x203/0x5f0 syzkaller/managers/linux-4-19/kernel/net/ipv4/ip_output.c:406 dst_output syzkaller/managers/linux-4-19/kernel/./include/net/dst.h:455 [inline] ip_local_out+0xaf/0x170 syzkaller/managers/linux-4-19/kernel/net/ipv4/ip_output.c:125 __ip_queue_xmit+0x866/0x1b50 syzkaller/managers/linux-4-19/kernel/net/ipv4/ip_output.c:506 __tcp_transmit_skb+0x1bb2/0x33f0 syzkaller/managers/linux-4-19/kernel/net/ipv4/tcp_output.c:1148 __tcp_send_ack.part.0+0x3d9/0x5c0 syzkaller/managers/linux-4-19/kernel/net/ipv4/tcp_output.c:3643 __tcp_send_ack syzkaller/managers/linux-4-19/kernel/net/ipv4/tcp_output.c:3649 [inline] tcp_send_ack+0x7d/0xa0 syzkaller/managers/linux-4-19/kernel/net/ipv4/tcp_output.c:3649 __tcp_ack_snd_check+0x152/0x890 syzkaller/managers/linux-4-19/kernel/net/ipv4/tcp_input.c:5207 tcp_rcv_established+0x17fa/0x1ea0 syzkaller/managers/linux-4-19/kernel/net/ipv4/tcp_input.c:5640 tcp_v4_do_rcv+0x5d6/0x870 syzkaller/managers/linux-4-19/kernel/net/ipv4/tcp_ipv4.c:1544 tcp_v4_rcv+0x2c03/0x3b80 syzkaller/managers/linux-4-19/kernel/net/ipv4/tcp_ipv4.c:1829 ip_local_deliver_finish+0x495/0xc00 syzkaller/managers/linux-4-19/kernel/net/ipv4/ip_input.c:215 NF_HOOK syzkaller/managers/linux-4-19/kernel/./include/linux/netfilter.h:289 [inline] ip_local_deliver+0x188/0x500 syzkaller/managers/linux-4-19/kernel/net/ipv4/ip_input.c:256 dst_input syzkaller/managers/linux-4-19/kernel/./include/net/dst.h:461 [inline] ip_rcv_finish+0x1ca/0x2e0 syzkaller/managers/linux-4-19/kernel/net/ipv4/ip_input.c:414 NF_HOOK syzkaller/managers/linux-4-19/kernel/./include/linux/netfilter.h:289 [inline] ip_rcv+0xca/0x3c0 syzkaller/managers/linux-4-19/kernel/net/ipv4/ip_input.c:524 __netif_receive_skb_one_core+0x114/0x180 syzkaller/managers/linux-4-19/kernel/net/core/dev.c:4954 __netif_receive_skb+0x27/0x1c0 syzkaller/managers/linux-4-19/kernel/net/core/dev.c:5066 netif_receive_skb_internal+0xf0/0x3f0 syzkaller/managers/linux-4-19/kernel/net/core/dev.c:5156 napi_skb_finish syzkaller/managers/linux-4-19/kernel/net/core/dev.c:5600 [inline] napi_gro_receive+0x2e6/0x450 syzkaller/managers/linux-4-19/kernel/net/core/dev.c:5631 receive_buf+0xf1d/0x6120 syzkaller/managers/linux-4-19/kernel/drivers/net/virtio_net.c:1072 virtnet_receive syzkaller/managers/linux-4-19/kernel/drivers/net/virtio_net.c:1336 [inline] virtnet_poll+0x568/0xd70 syzkaller/managers/linux-4-19/kernel/drivers/net/virtio_net.c:1441 napi_poll syzkaller/managers/linux-4-19/kernel/net/core/dev.c:6272 [inline] net_rx_action+0x4ac/0xfb0 syzkaller/managers/linux-4-19/kernel/net/core/dev.c:6338 __do_softirq+0x265/0x980 syzkaller/managers/linux-4-19/kernel/kernel/softirq.c:292 invoke_softirq syzkaller/managers/linux-4-19/kernel/kernel/softirq.c:372 [inline] irq_exit+0x215/0x260 syzkaller/managers/linux-4-19/kernel/kernel/softirq.c:412 exiting_irq syzkaller/managers/linux-4-19/kernel/./arch/x86/include/asm/apic.h:545 [inline] do_IRQ+0x10c/0x1c0 syzkaller/managers/linux-4-19/kernel/arch/x86/kernel/irq.c:258 common_interrupt+0xf/0xf syzkaller/managers/linux-4-19/kernel/arch/x86/entry/entry_64.S:670 RIP: 0010:arch_local_irq_restore syzkaller/managers/linux-4-19/kernel/./arch/x86/include/asm/paravirt.h:789 [inline] RIP: 0010:__raw_spin_unlock_irqrestore syzkaller/managers/linux-4-19/kernel/./include/linux/spinlock_api_smp.h:160 [inline] RIP: 0010:_raw_spin_unlock_irqrestore+0xa3/0xe0 syzkaller/managers/linux-4-19/kernel/kernel/locking/spinlock.c:184 Code: 48 c7 c0 08 82 f1 89 48 ba 00 00 00 00 00 fc ff df 48 c1 e8 03 80 3c 10 00 75 2f 48 83 3d 3c 5f db 01 00 74 15 48 89 df 57 9d <0f> 1f 44 00 00 eb b2 e8 3b 1a ea f8 eb c0 0f 0b 0f 0b 48 c7 c7 08 RSP: 0018:ffff8880389a7230 EFLAGS: 00000286 ORIG_RAX: ffffffffffffffd4 RAX: 1ffffffff13e3041 RBX: 0000000000000286 RCX: 1ffff11012d87d22 RDX: dffffc0000000000 RSI: ffff888096c3e918 RDI: 0000000000000286 RBP: ffffffff89f880c0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000000 R12: ffff888096c3e040 R13: ffffffff89f88180 R14: ffff888055810838 R15: ffffffff89f880c0 rcu_read_unlock_special+0x7ce/0xfc0 syzkaller/managers/linux-4-19/kernel/kernel/rcu/tree_plugin.h:587 __rcu_read_unlock+0x158/0x160 syzkaller/managers/linux-4-19/kernel/kernel/rcu/tree_plugin.h:428 rcu_read_unlock syzkaller/managers/linux-4-19/kernel/./include/linux/rcupdate.h:680 [inline] ext4_get_group_desc+0x1d6/0x4e0 syzkaller/managers/linux-4-19/kernel/fs/ext4/balloc.c:284 __ext4_get_inode_loc+0x19a/0x10f0 syzkaller/managers/linux-4-19/kernel/fs/ext4/inode.c:4609 ext4_write_inode+0x2ec/0x4d0 syzkaller/managers/linux-4-19/kernel/fs/ext4/inode.c:5467 write_inode syzkaller/managers/linux-4-19/kernel/fs/fs-writeback.c:1239 [inline] __writeback_single_inode+0x733/0x11d0 syzkaller/managers/linux-4-19/kernel/fs/fs-writeback.c:1437 writeback_single_inode+0x2a1/0x440 syzkaller/managers/linux-4-19/kernel/fs/fs-writeback.c:1491 sync_inode syzkaller/managers/linux-4-19/kernel/fs/fs-writeback.c:2526 [inline] sync_inode_metadata+0x93/0xd0 syzkaller/managers/linux-4-19/kernel/fs/fs-writeback.c:2546 __generic_file_fsync+0x15f/0x1f0 syzkaller/managers/linux-4-19/kernel/fs/libfs.c:996 ext4_sync_file+0xa35/0x1420 syzkaller/managers/linux-4-19/kernel/fs/ext4/fsync.c:118 vfs_fsync_range+0x13a/0x220 syzkaller/managers/linux-4-19/kernel/fs/sync.c:197 generic_write_sync syzkaller/managers/linux-4-19/kernel/./include/linux/fs.h:2750 [inline] ext4_file_write_iter+0x726/0xf20 syzkaller/managers/linux-4-19/kernel/fs/ext4/file.c:283 call_write_iter syzkaller/managers/linux-4-19/kernel/./include/linux/fs.h:1821 [inline] do_iter_readv_writev+0x668/0x790 syzkaller/managers/linux-4-19/kernel/fs/read_write.c:681 do_iter_write+0x182/0x5d0 syzkaller/managers/linux-4-19/kernel/fs/read_write.c:960 vfs_iter_write+0x70/0xa0 syzkaller/managers/linux-4-19/kernel/fs/read_write.c:973 iter_file_splice_write+0x60d/0xbb0 syzkaller/managers/linux-4-19/kernel/fs/splice.c:750 do_splice_from syzkaller/managers/linux-4-19/kernel/fs/splice.c:852 [inline] direct_splice_actor+0x115/0x160 syzkaller/managers/linux-4-19/kernel/fs/splice.c:1025 splice_direct_to_actor+0x33f/0x8d0 syzkaller/managers/linux-4-19/kernel/fs/splice.c:980 do_splice_direct+0x1a7/0x270 syzkaller/managers/linux-4-19/kernel/fs/splice.c:1068 do_sendfile+0x550/0xc30 syzkaller/managers/linux-4-19/kernel/fs/read_write.c:1447 __do_sys_sendfile64 syzkaller/managers/linux-4-19/kernel/fs/read_write.c:1508 [inline] __se_sys_sendfile64+0x147/0x160 syzkaller/managers/linux-4-19/kernel/fs/read_write.c:1494 do_syscall_64+0xf9/0x620 syzkaller/managers/linux-4-19/kernel/arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x465d99 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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 73 01 c3 48 c7 c1 bc ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fa737632188 EFLAGS: 00000246 ORIG_RAX: 0000000000000028 RAX: ffffffffffffffda RBX: 000000000056c008 RCX: 0000000000465d99 RDX: 0000000000000000 RSI: 0000000000000008 RDI: 0000000000000003 RBP: 00000000004bcf27 R08: 0000000000000000 R09: 0000000000000000 R10: 000000000000a198 R11: 0000000000000246 R12: 000000000056c008 R13: 00007fff6b04e15f R14: 00007fa737632300 R15: 0000000000022000 Allocated by task 23574: __do_kmalloc syzkaller/managers/linux-4-19/kernel/mm/slab.c:3727 [inline] __kmalloc+0x15a/0x3c0 syzkaller/managers/linux-4-19/kernel/mm/slab.c:3736 kmalloc syzkaller/managers/linux-4-19/kernel/./include/linux/slab.h:520 [inline] sk_prot_alloc+0x1e2/0x2d0 syzkaller/managers/linux-4-19/kernel/net/core/sock.c:1466 sk_alloc+0x36/0xec0 syzkaller/managers/linux-4-19/kernel/net/core/sock.c:1520 packet_create+0x117/0x850 syzkaller/managers/linux-4-19/kernel/net/packet/af_packet.c:3259 __sock_create+0x3d8/0x740 syzkaller/managers/linux-4-19/kernel/net/socket.c:1276 sock_create syzkaller/managers/linux-4-19/kernel/net/socket.c:1316 [inline] __sys_socket+0xef/0x200 syzkaller/managers/linux-4-19/kernel/net/socket.c:1346 __do_sys_socket syzkaller/managers/linux-4-19/kernel/net/socket.c:1355 [inline] __se_sys_socket syzkaller/managers/linux-4-19/kernel/net/socket.c:1353 [inline] __x64_sys_socket+0x6f/0xb0 syzkaller/managers/linux-4-19/kernel/net/socket.c:1353 do_syscall_64+0xf9/0x620 syzkaller/managers/linux-4-19/kernel/arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 23573: __cache_free syzkaller/managers/linux-4-19/kernel/mm/slab.c:3503 [inline] kfree+0xcc/0x210 syzkaller/managers/linux-4-19/kernel/mm/slab.c:3822 sk_prot_free syzkaller/managers/linux-4-19/kernel/net/core/sock.c:1503 [inline] __sk_destruct+0x684/0x8a0 syzkaller/managers/linux-4-19/kernel/net/core/sock.c:1584 sk_destruct syzkaller/managers/linux-4-19/kernel/net/core/sock.c:1599 [inline] __sk_free+0x165/0x3b0 syzkaller/managers/linux-4-19/kernel/net/core/sock.c:1610 sk_free+0x3b/0x50 syzkaller/managers/linux-4-19/kernel/net/core/sock.c:1621 sock_put syzkaller/managers/linux-4-19/kernel/./include/net/sock.h:1711 [inline] packet_release+0x890/0xb70 syzkaller/managers/linux-4-19/kernel/net/packet/af_packet.c:3088 __sock_release+0xcd/0x2a0 syzkaller/managers/linux-4-19/kernel/net/socket.c:579 sock_close+0x15/0x20 syzkaller/managers/linux-4-19/kernel/net/socket.c:1140 __fput+0x2ce/0x890 syzkaller/managers/linux-4-19/kernel/fs/file_table.c:278 task_work_run+0x148/0x1c0 syzkaller/managers/linux-4-19/kernel/kernel/task_work.c:113 tracehook_notify_resume syzkaller/managers/linux-4-19/kernel/./include/linux/tracehook.h:193 [inline] exit_to_usermode_loop+0x251/0x2a0 syzkaller/managers/linux-4-19/kernel/arch/x86/entry/common.c:167 prepare_exit_to_usermode syzkaller/managers/linux-4-19/kernel/arch/x86/entry/common.c:198 [inline] syscall_return_slowpath syzkaller/managers/linux-4-19/kernel/arch/x86/entry/common.c:271 [inline] do_syscall_64+0x538/0x620 syzkaller/managers/linux-4-19/kernel/arch/x86/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff8880aaf5ed40 which belongs to the cache kmalloc-2048 of size 2048 The buggy address is located 2032 bytes inside of 2048-byte region [ffff8880aaf5ed40, ffff8880aaf5f540) The buggy address belongs to the page: page:ffffea0002abd780 count:1 mapcount:0 mapping:ffff88813bff0c40 index:0x0 compound_mapcount: 0 flags: 0xfff00000008100(slab|head) raw: 00fff00000008100 ffffea000160af88 ffffea00014dda08 ffff88813bff0c40 raw: 0000000000000000 ffff8880aaf5e4c0 0000000100000003 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880aaf5f400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880aaf5f480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8880aaf5f500: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ^ ffff8880aaf5f580: fc fc fc fc fc fc fc fc 00 00 00 00 00 00 00 00 ffff8880aaf5f600: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================