================================================================== 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 6 at addr ffff8880931bb5da by task syz-executor.4/26791 CPU: 1 PID: 26791 Comm: syz-executor.4 Not tainted 4.19.147-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+0x22c/0x33e lib/dump_stack.c:118 print_address_description.cold+0x56/0x25c mm/kasan/report.c:256 kasan_report_error.cold+0x66/0xb9 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+0x112a/0x1750 drivers/video/fbdev/core/bitblit.c:377 fbcon_cursor+0x593/0x7f0 drivers/video/fbdev/core/fbcon.c:1309 hide_cursor+0x85/0x2c0 drivers/tty/vt/vt.c:902 do_con_write+0x14ec/0x1f40 drivers/tty/vt/vt.c:2604 con_write+0x22/0xb0 drivers/tty/vt/vt.c:3145 do_output_char+0x5de/0x850 drivers/tty/n_tty.c:445 process_output drivers/tty/n_tty.c:512 [inline] n_tty_write+0x46e/0xff0 drivers/tty/n_tty.c:2343 do_tty_write drivers/tty/tty_io.c:960 [inline] tty_write+0x496/0x890 drivers/tty/tty_io.c:1044 __vfs_write+0xf7/0x770 fs/read_write.c:485 __kernel_write+0x109/0x370 fs/read_write.c:506 write_pipe_buf+0x153/0x1f0 fs/splice.c:798 splice_from_pipe_feed fs/splice.c:503 [inline] __splice_from_pipe+0x3af/0x820 fs/splice.c:627 splice_from_pipe fs/splice.c:662 [inline] default_file_splice_write+0xd8/0x180 fs/splice.c:810 do_splice_from fs/splice.c:852 [inline] direct_splice_actor+0x115/0x160 fs/splice.c:1025 splice_direct_to_actor+0x33f/0x8d0 fs/splice.c:980 do_splice_direct+0x1a7/0x270 fs/splice.c:1068 do_sendfile+0x550/0xc30 fs/read_write.c:1447 __do_sys_sendfile64 fs/read_write.c:1508 [inline] __se_sys_sendfile64+0x147/0x160 fs/read_write.c:1494 do_syscall_64+0xf9/0x670 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x45e179 Code: 3d b2 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 0b b2 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007fc5542dfc78 EFLAGS: 00000246 ORIG_RAX: 0000000000000028 RAX: ffffffffffffffda RBX: 0000000000027ec0 RCX: 000000000045e179 RDX: 0000000000000000 RSI: 0000000000000007 RDI: 0000000000000006 RBP: 000000000118cf88 R08: 0000000000000000 R09: 0000000000000000 R10: 0800000080004103 R11: 0000000000000246 R12: 000000000118cf4c R13: 00007ffe0fb9ccdf R14: 00007fc5542e09c0 R15: 000000000118cf4c Allocated by task 25597: __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/0x580 net/core/skbuff.c:205 alloc_skb include/linux/skbuff.h:995 [inline] sock_wmalloc+0xd0/0x120 net/core/sock.c:1942 pppol2tp_sendmsg+0x234/0x670 net/l2tp/l2tp_ppp.c:302 sock_sendmsg_nosec net/socket.c:622 [inline] sock_sendmsg+0xc7/0x130 net/socket.c:632 ___sys_sendmsg+0x3b3/0x8f0 net/socket.c:2115 __sys_sendmmsg+0x195/0x470 net/socket.c:2210 __do_sys_sendmmsg net/socket.c:2239 [inline] __se_sys_sendmmsg net/socket.c:2236 [inline] __x64_sys_sendmmsg+0x99/0x100 net/socket.c:2236 do_syscall_64+0xf9/0x670 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 25597: __cache_free mm/slab.c:3503 [inline] kfree+0xcc/0x250 mm/slab.c:3822 skb_free_head net/core/skbuff.c:554 [inline] pskb_expand_head+0x329/0xfc0 net/core/skbuff.c:1497 __skb_cow include/linux/skbuff.h:2951 [inline] skb_cow_head include/linux/skbuff.h:2985 [inline] l2tp_xmit_skb+0xbd2/0x13f0 net/l2tp/l2tp_core.c:1078 pppol2tp_sendmsg+0x473/0x670 net/l2tp/l2tp_ppp.c:329 sock_sendmsg_nosec net/socket.c:622 [inline] sock_sendmsg+0xc7/0x130 net/socket.c:632 ___sys_sendmsg+0x3b3/0x8f0 net/socket.c:2115 __sys_sendmmsg+0x195/0x470 net/socket.c:2210 __do_sys_sendmmsg net/socket.c:2239 [inline] __se_sys_sendmmsg net/socket.c:2236 [inline] __x64_sys_sendmmsg+0x99/0x100 net/socket.c:2236 do_syscall_64+0xf9/0x670 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff8880931bb580 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 90 bytes inside of 512-byte region [ffff8880931bb580, ffff8880931bb780) The buggy address belongs to the page: page:ffffea00024c6ec0 count:1 mapcount:0 mapping:ffff88812c3f6940 index:0xffff8880931bb580 flags: 0xfffe0000000100(slab) raw: 00fffe0000000100 ffffea0002700c88 ffffea00012e3788 ffff88812c3f6940 raw: ffff8880931bb580 ffff8880931bb080 0000000100000004 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880931bb480: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8880931bb500: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8880931bb580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880931bb600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880931bb680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== xt_l2tp: v2 tid > 0xffff: 33554432