================================================================== BUG: KASAN: use-after-free in memcpy include/linux/string.h:373 [inline] BUG: KASAN: use-after-free in soft_cursor+0x44b/0xa30 drivers/video/fbdev/core/softcursor.c:70 Read of size 9 at addr ffff88808f5a65be by task syz-executor.2/31119 CPU: 0 PID: 31119 Comm: syz-executor.2 Not tainted 4.19.136-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+0x8f/0x96 mm/kasan/report.c:412 memcpy+0x20/0x50 mm/kasan/kasan.c:302 memcpy include/linux/string.h:373 [inline] soft_cursor+0x44b/0xa30 drivers/video/fbdev/core/softcursor.c:70 bit_cursor+0x1239/0x1820 drivers/video/fbdev/core/bitblit.c:386 fbcon_cursor+0x555/0x760 drivers/video/fbdev/core/fbcon.c:1372 hide_cursor+0x85/0x2c0 drivers/tty/vt/vt.c:902 redraw_screen+0x2ed/0x870 drivers/tty/vt/vt.c:1006 vc_do_resize+0x1137/0x1440 drivers/tty/vt/vt.c:1323 vt_ioctl+0x1f74/0x24d0 drivers/tty/vt/vt_ioctl.c:901 tty_ioctl+0x5b0/0x15c0 drivers/tty/tty_io.c:2669 vfs_ioctl fs/ioctl.c:46 [inline] file_ioctl fs/ioctl.c:501 [inline] do_vfs_ioctl+0xcdb/0x12e0 fs/ioctl.c:688 ksys_ioctl+0x9b/0xc0 fs/ioctl.c:705 __do_sys_ioctl fs/ioctl.c:712 [inline] __se_sys_ioctl fs/ioctl.c:710 [inline] __x64_sys_ioctl+0x6f/0xb0 fs/ioctl.c:710 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x45cc79 Code: 2d b6 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 fb b5 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007f431add0c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 000000000001c300 RCX: 000000000045cc79 RDX: 0000000020000000 RSI: 000000000000560a RDI: 0000000000000003 RBP: 000000000078bf40 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000078bf0c R13: 00007ffe485abd7f R14: 00007f431add19c0 R15: 000000000078bf0c Allocated by task 6463: __do_kmalloc_node mm/slab.c:3689 [inline] __kmalloc_node_track_caller+0x4c/0x70 mm/slab.c:3703 __kmalloc_reserve net/core/skbuff.c:137 [inline] __alloc_skb+0xae/0x560 net/core/skbuff.c:205 alloc_skb_fclone include/linux/skbuff.h:1037 [inline] sk_stream_alloc_skb+0xba/0x850 net/ipv4/tcp.c:882 tcp_sendmsg_locked+0xc01/0x2f60 net/ipv4/tcp.c:1310 tcp_sendmsg+0x2b/0x40 net/ipv4/tcp.c:1460 inet_sendmsg+0x132/0x5a0 net/ipv4/af_inet.c:798 sock_sendmsg_nosec net/socket.c:622 [inline] sock_sendmsg+0xc3/0x120 net/socket.c:632 sock_write_iter+0x287/0x3c0 net/socket.c:901 call_write_iter include/linux/fs.h:1821 [inline] new_sync_write fs/read_write.c:474 [inline] __vfs_write+0x51b/0x770 fs/read_write.c:487 vfs_write+0x1f3/0x540 fs/read_write.c:549 ksys_write+0x12b/0x2a0 fs/read_write.c:599 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 6463: __cache_free mm/slab.c:3503 [inline] kfree+0xcc/0x210 mm/slab.c:3822 skb_free_head net/core/skbuff.c:554 [inline] skb_release_data+0x6de/0x920 net/core/skbuff.c:574 skb_release_all net/core/skbuff.c:631 [inline] __kfree_skb+0x46/0x60 net/core/skbuff.c:645 sk_wmem_free_skb include/net/sock.h:1462 [inline] tcp_rtx_queue_unlink_and_free include/net/tcp.h:1764 [inline] tcp_clean_rtx_queue net/ipv4/tcp_input.c:3154 [inline] tcp_ack+0x1d20/0x4fc0 net/ipv4/tcp_input.c:3689 tcp_rcv_established+0x13b9/0x1e20 net/ipv4/tcp_input.c:5586 tcp_v4_do_rcv+0x5d6/0x870 net/ipv4/tcp_ipv4.c:1544 sk_backlog_rcv include/net/sock.h:946 [inline] __release_sock+0x134/0x3a0 net/core/sock.c:2344 release_sock+0x54/0x1b0 net/core/sock.c:2860 tcp_sendmsg+0x36/0x40 net/ipv4/tcp.c:1461 inet_sendmsg+0x132/0x5a0 net/ipv4/af_inet.c:798 sock_sendmsg_nosec net/socket.c:622 [inline] sock_sendmsg+0xc3/0x120 net/socket.c:632 sock_write_iter+0x287/0x3c0 net/socket.c:901 call_write_iter include/linux/fs.h:1821 [inline] new_sync_write fs/read_write.c:474 [inline] __vfs_write+0x51b/0x770 fs/read_write.c:487 vfs_write+0x1f3/0x540 fs/read_write.c:549 ksys_write+0x12b/0x2a0 fs/read_write.c:599 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff88808f5a6480 which belongs to the cache kmalloc-1024 of size 1024 The buggy address is located 318 bytes inside of 1024-byte region [ffff88808f5a6480, ffff88808f5a6880) The buggy address belongs to the page: page:ffffea00023d6980 count:1 mapcount:0 mapping:ffff88812c39cac0 index:0x0 compound_mapcount: 0 flags: 0xfffe0000008100(slab|head) raw: 00fffe0000008100 ffffea0001493b88 ffffea00015f5088 ffff88812c39cac0 raw: 0000000000000000 ffff88808f5a6000 0000000100000007 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88808f5a6480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88808f5a6500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88808f5a6580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88808f5a6600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88808f5a6680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================