================================================================== BUG: KASAN: use-after-free in scr_memcpyw include/linux/vt_buffer.h:49 [inline] BUG: KASAN: use-after-free in vc_do_resize+0xe2e/0x1d00 drivers/tty/vt/vt.c:1286 Read of size 2 at addr ffff8880a68d4182 by task syz-executor.0/7096 CPU: 0 PID: 7096 Comm: syz-executor.0 Not tainted 5.8.0-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+0x1f0/0x31e lib/dump_stack.c:118 print_address_description+0x66/0x5a0 mm/kasan/report.c:383 __kasan_report mm/kasan/report.c:513 [inline] kasan_report+0x132/0x1d0 mm/kasan/report.c:530 check_memory_region_inline mm/kasan/generic.c:183 [inline] check_memory_region+0x2b5/0x2f0 mm/kasan/generic.c:192 memcpy+0x25/0x60 mm/kasan/common.c:105 scr_memcpyw include/linux/vt_buffer.h:49 [inline] vc_do_resize+0xe2e/0x1d00 drivers/tty/vt/vt.c:1286 fbcon_modechanged+0x710/0xd90 drivers/video/fbdev/core/fbcon.c:2990 fb_set_var+0x825/0xcc0 drivers/video/fbdev/core/fbmem.c:1056 do_fb_ioctl+0x502/0x6f0 drivers/video/fbdev/core/fbmem.c:1109 vfs_ioctl fs/ioctl.c:48 [inline] ksys_ioctl fs/ioctl.c:753 [inline] __do_sys_ioctl fs/ioctl.c:762 [inline] __se_sys_ioctl+0xf9/0x160 fs/ioctl.c:760 do_syscall_64+0x73/0xe0 arch/x86/entry/common.c:384 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x45cce9 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:00007f4d4b387c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 000000000000d540 RCX: 000000000045cce9 RDX: 0000000020000000 RSI: 0000000000004601 RDI: 0000000000000003 RBP: 000000000078bf40 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000078bf0c R13: 00007ffe2502b86f R14: 00007f4d4b3889c0 R15: 000000000078bf0c Allocated by task 1: save_stack mm/kasan/common.c:48 [inline] set_track mm/kasan/common.c:56 [inline] __kasan_kmalloc+0x103/0x140 mm/kasan/common.c:494 __do_kmalloc mm/slab.c:3656 [inline] __kmalloc+0x24b/0x330 mm/slab.c:3665 kmalloc include/linux/slab.h:560 [inline] kzalloc include/linux/slab.h:669 [inline] tomoyo_encode2+0x25a/0x560 security/tomoyo/realpath.c:45 tomoyo_encode security/tomoyo/realpath.c:80 [inline] tomoyo_realpath_from_path+0x5d6/0x630 security/tomoyo/realpath.c:288 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_path_perm+0x17d/0x740 security/tomoyo/file.c:822 security_inode_getattr+0xc0/0x140 security/security.c:1278 vfs_getattr fs/stat.c:121 [inline] vfs_statx+0x118/0x380 fs/stat.c:206 vfs_lstat include/linux/fs.h:3302 [inline] __do_sys_newlstat fs/stat.c:374 [inline] __se_sys_newlstat fs/stat.c:368 [inline] __x64_sys_newlstat+0x81/0xd0 fs/stat.c:368 do_syscall_64+0x73/0xe0 arch/x86/entry/common.c:384 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Freed by task 1: save_stack mm/kasan/common.c:48 [inline] set_track mm/kasan/common.c:56 [inline] kasan_set_free_info mm/kasan/common.c:316 [inline] __kasan_slab_free+0x114/0x170 mm/kasan/common.c:455 __cache_free mm/slab.c:3426 [inline] kfree+0x10a/0x220 mm/slab.c:3757 tomoyo_path_perm+0x59b/0x740 security/tomoyo/file.c:842 security_inode_getattr+0xc0/0x140 security/security.c:1278 vfs_getattr fs/stat.c:121 [inline] vfs_statx+0x118/0x380 fs/stat.c:206 vfs_lstat include/linux/fs.h:3302 [inline] __do_sys_newlstat fs/stat.c:374 [inline] __se_sys_newlstat fs/stat.c:368 [inline] __x64_sys_newlstat+0x81/0xd0 fs/stat.c:368 do_syscall_64+0x73/0xe0 arch/x86/entry/common.c:384 entry_SYSCALL_64_after_hwframe+0x44/0xa9 The buggy address belongs to the object at ffff8880a68d4180 which belongs to the cache kmalloc-32 of size 32 The buggy address is located 2 bytes inside of 32-byte region [ffff8880a68d4180, ffff8880a68d41a0) The buggy address belongs to the page: page:ffffea00029a3500 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff8880a68d4fc1 flags: 0xfffe0000000200(slab) raw: 00fffe0000000200 ffffea00027b9488 ffffea00024ebc08 ffff8880aa4001c0 raw: ffff8880a68d4fc1 ffff8880a68d4000 000000010000003f 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880a68d4080: 00 00 01 fc fc fc fc fc 00 04 fc fc fc fc fc fc ffff8880a68d4100: 00 04 fc fc fc fc fc fc fb fb fb fb fc fc fc fc >ffff8880a68d4180: fb fb fb fb fc fc fc fc 00 00 01 fc fc fc fc fc ^ ffff8880a68d4200: fb fb fb fb fc fc fc fc fb fb fb fb fc fc fc fc ffff8880a68d4280: 00 00 01 fc fc fc fc fc 00 00 00 fc fc fc fc fc ==================================================================