================================================================== BUG: KASAN: use-after-free in con_shutdown+0x85/0x90 drivers/tty/vt/vt.c:3289 Write of size 8 at addr ffff8880a6f80108 by task syz-executor.3/13671 CPU: 0 PID: 13671 Comm: syz-executor.3 Not tainted 5.6.0-rc3-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+0x197/0x210 lib/dump_stack.c:118 print_address_description.constprop.0.cold+0xd4/0x30b mm/kasan/report.c:374 __kasan_report.cold+0x1b/0x32 mm/kasan/report.c:506 kasan_report+0x12/0x20 mm/kasan/common.c:641 __asan_report_store8_noabort+0x17/0x20 mm/kasan/generic_report.c:140 con_shutdown+0x85/0x90 drivers/tty/vt/vt.c:3289 release_tty+0xd3/0x470 drivers/tty/tty_io.c:1514 tty_release_struct+0x3c/0x50 drivers/tty/tty_io.c:1629 tty_release+0xbcb/0xe90 drivers/tty/tty_io.c:1789 __fput+0x2ff/0x890 fs/file_table.c:280 ____fput+0x16/0x20 fs/file_table.c:313 task_work_run+0x145/0x1c0 kernel/task_work.c:113 tracehook_notify_resume include/linux/tracehook.h:188 [inline] exit_to_usermode_loop+0x316/0x380 arch/x86/entry/common.c:164 prepare_exit_to_usermode arch/x86/entry/common.c:195 [inline] syscall_return_slowpath arch/x86/entry/common.c:278 [inline] do_syscall_32_irqs_on arch/x86/entry/common.c:352 [inline] do_fast_syscall_32+0xbbd/0xe16 arch/x86/entry/common.c:408 entry_SYSENTER_compat+0x70/0x7f arch/x86/entry/entry_64_compat.S:139 RIP: 0023:0xf7f5be39 Code: 1d 00 00 00 89 d3 5b 5e 5d c3 8b 04 24 c3 8b 1c 24 c3 8b 3c 24 c3 90 90 90 90 90 90 90 90 90 90 90 51 52 55 89 e5 0f 34 cd 80 <5d> 5a 59 c3 90 90 90 90 eb 0d 90 90 90 90 90 90 90 90 90 90 90 90 RSP: 002b:000000000868fbec EFLAGS: 00000212 ORIG_RAX: 0000000000000006 RAX: 0000000000000000 RBX: 0000000000000004 RCX: 0000000000000000 RDX: 0000000000000005 RSI: 00000000ffffffff RDI: 0000000000000000 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 Allocated by task 13677: save_stack+0x23/0x90 mm/kasan/common.c:72 set_track mm/kasan/common.c:80 [inline] __kasan_kmalloc mm/kasan/common.c:515 [inline] __kasan_kmalloc.constprop.0+0xcf/0xe0 mm/kasan/common.c:488 kasan_kmalloc+0x9/0x10 mm/kasan/common.c:529 kmem_cache_alloc_trace+0x158/0x790 mm/slab.c:3551 kmalloc include/linux/slab.h:555 [inline] kzalloc include/linux/slab.h:669 [inline] vc_allocate drivers/tty/vt/vt.c:1096 [inline] vc_allocate+0x1fc/0x760 drivers/tty/vt/vt.c:1077 con_install+0x52/0x410 drivers/tty/vt/vt.c:3240 tty_driver_install_tty drivers/tty/tty_io.c:1228 [inline] tty_init_dev drivers/tty/tty_io.c:1341 [inline] tty_init_dev+0xf9/0x470 drivers/tty/tty_io.c:1318 tty_open_by_driver drivers/tty/tty_io.c:1987 [inline] tty_open+0x4a5/0xbb0 drivers/tty/tty_io.c:2035 chrdev_open+0x245/0x6b0 fs/char_dev.c:414 do_dentry_open+0x4e6/0x1380 fs/open.c:797 vfs_open+0xa0/0xd0 fs/open.c:914 do_last fs/namei.c:3490 [inline] path_openat+0x12ee/0x3490 fs/namei.c:3607 do_filp_open+0x192/0x260 fs/namei.c:3637 do_sys_openat2+0x5eb/0x7e0 fs/open.c:1149 do_sys_open+0xf2/0x180 fs/open.c:1165 __do_compat_sys_open fs/open.c:1212 [inline] __se_compat_sys_open fs/open.c:1210 [inline] __ia32_compat_sys_open+0x79/0xb0 fs/open.c:1210 do_syscall_32_irqs_on arch/x86/entry/common.c:337 [inline] do_fast_syscall_32+0x27b/0xe16 arch/x86/entry/common.c:408 entry_SYSENTER_compat+0x70/0x7f arch/x86/entry/entry_64_compat.S:139 Freed by task 13682: save_stack+0x23/0x90 mm/kasan/common.c:72 set_track mm/kasan/common.c:80 [inline] kasan_set_free_info mm/kasan/common.c:337 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/common.c:476 kasan_slab_free+0xe/0x10 mm/kasan/common.c:485 __cache_free mm/slab.c:3426 [inline] kfree+0x10a/0x2c0 mm/slab.c:3757 vt_disallocate_all+0x2bd/0x3e0 drivers/tty/vt/vt_ioctl.c:323 vt_ioctl+0xc38/0x26c0 drivers/tty/vt/vt_ioctl.c:816 vt_compat_ioctl+0x457/0x7a0 drivers/tty/vt/vt_ioctl.c:1237 tty_compat_ioctl+0x1b0/0x420 drivers/tty/tty_io.c:2849 __do_compat_sys_ioctl fs/ioctl.c:857 [inline] __se_compat_sys_ioctl fs/ioctl.c:808 [inline] __ia32_compat_sys_ioctl+0x245/0x2c0 fs/ioctl.c:808 do_syscall_32_irqs_on arch/x86/entry/common.c:337 [inline] do_fast_syscall_32+0x27b/0xe16 arch/x86/entry/common.c:408 entry_SYSENTER_compat+0x70/0x7f arch/x86/entry/entry_64_compat.S:139 The buggy address belongs to the object at ffff8880a6f80000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 264 bytes inside of 2048-byte region [ffff8880a6f80000, ffff8880a6f80800) The buggy address belongs to the page: page:ffffea00029be000 refcount:1 mapcount:0 mapping:ffff8880aa400e00 index:0x0 flags: 0xfffe0000000200(slab) raw: 00fffe0000000200 ffffea0002846248 ffffea000281af88 ffff8880aa400e00 raw: 0000000000000000 ffff8880a6f80000 0000000100000001 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880a6f80000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880a6f80080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8880a6f80100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880a6f80180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880a6f80200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================