================================================================== BUG: KASAN: slab-out-of-bounds in complement_pos+0x645/0x6f0 drivers/tty/vt/vt.c:828 Read of size 2 at addr ffff888040d067ea by task syz-executor.2/9603 CPU: 1 PID: 9603 Comm: syz-executor.2 Not tainted 5.10.161 #1 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.12.0-1 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x107/0x167 lib/dump_stack.c:118 print_address_description.constprop.0+0x1c/0x220 mm/kasan/report.c:385 __kasan_report mm/kasan/report.c:545 [inline] kasan_report.cold+0x37/0x7c mm/kasan/report.c:562 complement_pos+0x645/0x6f0 drivers/tty/vt/vt.c:828 highlight_pointer drivers/tty/vt/selection.c:63 [inline] vc_do_selection drivers/tty/vt/selection.c:267 [inline] vc_selection+0x66a/0x13a0 drivers/tty/vt/selection.c:350 set_selection_kernel drivers/tty/vt/selection.c:359 [inline] set_selection_user+0x115/0x190 drivers/tty/vt/selection.c:185 tioclinux+0x35b/0x5b0 drivers/tty/vt/vt.c:3201 vt_ioctl+0x1ee5/0x2c90 drivers/tty/vt/vt_ioctl.c:762 tty_ioctl+0x862/0x1840 drivers/tty/tty_io.c:2742 vfs_ioctl fs/ioctl.c:48 [inline] __do_sys_ioctl fs/ioctl.c:753 [inline] __se_sys_ioctl fs/ioctl.c:739 [inline] __x64_sys_ioctl+0x19a/0x210 fs/ioctl.c:739 do_syscall_64+0x33/0x40 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x61/0xc6 RIP: 0033:0x7f3fbead3b19 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:00007f3fbc049188 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007f3fbebe6f60 RCX: 00007f3fbead3b19 RDX: 0000000020000080 RSI: 000000000000541c RDI: 0000000000000005 RBP: 00007f3fbeb2df6d R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffef412896f R14: 00007f3fbc049300 R15: 0000000000022000 Allocated by task 9562: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:48 kasan_set_track mm/kasan/common.c:56 [inline] __kasan_kmalloc.constprop.0+0xc9/0xd0 mm/kasan/common.c:461 kmalloc include/linux/slab.h:557 [inline] kzalloc include/linux/slab.h:664 [inline] vc_do_resize+0x36c/0x1180 drivers/tty/vt/vt.c:1245 vt_ioctl+0x14be/0x2c90 drivers/tty/vt/vt_ioctl.c:926 tty_ioctl+0x862/0x1840 drivers/tty/tty_io.c:2742 vfs_ioctl fs/ioctl.c:48 [inline] __do_sys_ioctl fs/ioctl.c:753 [inline] __se_sys_ioctl fs/ioctl.c:739 [inline] __x64_sys_ioctl+0x19a/0x210 fs/ioctl.c:739 do_syscall_64+0x33/0x40 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x61/0xc6 The buggy address belongs to the object at ffff888040d04000 which belongs to the cache kmalloc-8k of size 8192 The buggy address is located 2026 bytes to the right of 8192-byte region [ffff888040d04000, ffff888040d06000) The buggy address belongs to the page: page:00000000c2ec2cfb refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x40d00 head:00000000c2ec2cfb order:3 compound_mapcount:0 compound_pincount:0 flags: 0x100000000010200(slab|head) raw: 0100000000010200 dead000000000100 dead000000000122 ffff888007c42280 raw: 0000000000000000 0000000000020002 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888040d06680: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888040d06700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888040d06780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff888040d06800: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888040d06880: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ================================================================== kmemleak: 9 new suspected memory leaks (see /sys/kernel/debug/kmemleak)