================================================================== BUG: KASAN: use-after-free in memcpy include/linux/fortify-string.h:191 [inline] BUG: KASAN: use-after-free in page_to_skb+0x5cf/0xb70 drivers/net/virtio_net.c:480 Read of size 12 at addr ffff88802b727800 by task sshd/8406 CPU: 1 PID: 8406 Comm: sshd Not tainted 5.12.0-rc7-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:79 [inline] dump_stack+0x141/0x1d7 lib/dump_stack.c:120 print_address_description.constprop.0.cold+0x5b/0x2f8 mm/kasan/report.c:232 __kasan_report mm/kasan/report.c:399 [inline] kasan_report.cold+0x7c/0xd8 mm/kasan/report.c:416 check_region_inline mm/kasan/generic.c:180 [inline] kasan_check_range+0x13d/0x180 mm/kasan/generic.c:186 memcpy+0x20/0x60 mm/kasan/shadow.c:65 memcpy include/linux/fortify-string.h:191 [inline] page_to_skb+0x5cf/0xb70 drivers/net/virtio_net.c:480 receive_mergeable drivers/net/virtio_net.c:1009 [inline] receive_buf+0x2b82/0x6220 drivers/net/virtio_net.c:1119 virtnet_receive drivers/net/virtio_net.c:1411 [inline] virtnet_poll+0x568/0x10b0 drivers/net/virtio_net.c:1516 __napi_poll+0xaf/0x440 net/core/dev.c:6962 napi_poll net/core/dev.c:7029 [inline] net_rx_action+0x801/0xb40 net/core/dev.c:7116 __do_softirq+0x29b/0x9f6 kernel/softirq.c:345 invoke_softirq kernel/softirq.c:221 [inline] __irq_exit_rcu kernel/softirq.c:422 [inline] irq_exit_rcu+0x134/0x200 kernel/softirq.c:434 common_interrupt+0xa4/0xd0 arch/x86/kernel/irq.c:240 asm_common_interrupt+0x1e/0x40 arch/x86/include/asm/idtentry.h:623 RIP: 0010:tcp_recvmsg_locked+0x799/0x22f0 net/ipv4/tcp.c:2520 Code: 89 d8 48 c1 e8 03 42 80 3c 30 00 0f 85 99 19 00 00 48 8b 1b 31 ff 83 e3 04 48 89 de e8 50 2e f4 f9 48 85 db 0f 84 f6 03 00 00 22 26 f4 f9 8b 74 24 2c 4c 89 ff e8 76 e0 ff ff e8 11 26 f4 f9 RSP: 0018:ffffc9000c7df900 EFLAGS: 00000246 RAX: 0000000000000000 RBX: 0000000000000010 RCX: 0000000000000000 RDX: ffff888020aed4c0 RSI: ffffffff877fce93 RDI: ffff888019ae8218 RBP: 0000000000000001 R08: 0000000000000010 R09: 0000000000000000 R10: ffffffff877fce8a R11: 0000000000000000 R12: 0000000000000000 R13: 0000000000000010 R14: dffffc0000000000 R15: ffff888019ae8000 tcp_recvmsg+0x134/0x550 net/ipv4/tcp.c:2550 inet_recvmsg+0x11b/0x5d0 net/ipv4/af_inet.c:852 sock_recvmsg_nosec net/socket.c:888 [inline] sock_recvmsg net/socket.c:906 [inline] sock_recvmsg net/socket.c:902 [inline] sock_read_iter+0x33c/0x470 net/socket.c:979 call_read_iter include/linux/fs.h:1971 [inline] new_sync_read+0x5b7/0x6e0 fs/read_write.c:415 vfs_read+0x35c/0x570 fs/read_write.c:496 ksys_read+0x1ee/0x250 fs/read_write.c:634 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7f83b1342910 Code: b6 fe ff ff 48 8d 3d 0f be 08 00 48 83 ec 08 e8 06 db 01 00 66 0f 1f 44 00 00 83 3d f9 2d 2c 00 00 75 10 b8 00 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 31 c3 48 83 ec 08 e8 de 9b 01 00 48 89 04 24 RSP: 002b:00007ffec72708f8 EFLAGS: 00000246 ORIG_RAX: 0000000000000000 RAX: ffffffffffffffda RBX: 000055a1200f5e30 RCX: 00007f83b1342910 RDX: 0000000000002000 RSI: 00007ffec7270950 RDI: 0000000000000003 RBP: 000055a1200f4da0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffec7270940 R14: 00007ffec7270930 R15: 00007ffec727092c The buggy address belongs to the page: page:ffffea0000adc9c0 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x2b727 flags: 0xfff00000000000() raw: 00fff00000000000 0000000000000000 ffffea0000adc9c8 0000000000000000 raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88802b727700: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88802b727780: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff88802b727800: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff88802b727880: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88802b727900: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================