audit: type=1400 audit(1583556580.191:36): avc: denied { map } for pid=8245 comm="syz-executor302" path="/root/syz-executor302355151" dev="sda1" ino=16484 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:user_home_t:s0 tclass=file permissive=1 ================================================================== BUG: KASAN: use-after-free in con_shutdown+0x7f/0x90 drivers/tty/vt/vt.c:3264 Write of size 8 at addr ffff88808d23f6c8 by task syz-executor302/8254 CPU: 1 PID: 8254 Comm: syz-executor302 Not tainted 4.19.108-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+0x188/0x20d lib/dump_stack.c:118 print_address_description.cold+0x7c/0x212 mm/kasan/report.c:256 kasan_report_error mm/kasan/report.c:354 [inline] kasan_report mm/kasan/report.c:412 [inline] kasan_report.cold+0x88/0x2b9 mm/kasan/report.c:396 con_shutdown+0x7f/0x90 drivers/tty/vt/vt.c:3264 release_tty+0xda/0x4c0 drivers/tty/tty_io.c:1509 tty_release_struct+0x37/0x50 drivers/tty/tty_io.c:1624 tty_release+0xbc7/0xe90 drivers/tty/tty_io.c:1784 __fput+0x2cd/0x890 fs/file_table.c:278 task_work_run+0x13f/0x1b0 kernel/task_work.c:113 exit_task_work include/linux/task_work.h:22 [inline] do_exit+0xbcd/0x2f30 kernel/exit.c:880 do_group_exit+0x125/0x350 kernel/exit.c:983 __do_sys_exit_group kernel/exit.c:994 [inline] __se_sys_exit_group kernel/exit.c:992 [inline] __x64_sys_exit_group+0x3a/0x50 kernel/exit.c:992 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x43ff38 Code: 00 00 be 3c 00 00 00 eb 19 66 0f 1f 84 00 00 00 00 00 48 89 d7 89 f0 0f 05 48 3d 00 f0 ff ff 77 21 f4 48 89 d7 44 89 c0 0f 05 <48> 3d 00 f0 ff ff 76 e0 f7 d8 64 41 89 01 eb d8 0f 1f 84 00 00 00 RSP: 002b:00007fffefab12f8 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 000000000043ff38 RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000 RBP: 00000000004bf950 R08: 00000000000000e7 R09: ffffffffffffffd0 R10: 0000000000000064 R11: 0000000000000246 R12: 0000000000000001 R13: 00000000006d2180 R14: 0000000000000000 R15: 0000000000000000 Allocated by task 8254: set_track mm/kasan/kasan.c:460 [inline] kasan_kmalloc mm/kasan/kasan.c:553 [inline] kasan_kmalloc+0xbf/0xe0 mm/kasan/kasan.c:531 kmem_cache_alloc_trace+0x14d/0x7a0 mm/slab.c:3625 kmalloc include/linux/slab.h:515 [inline] kzalloc include/linux/slab.h:709 [inline] vc_allocate drivers/tty/vt/vt.c:1099 [inline] vc_allocate+0x1db/0x6d0 drivers/tty/vt/vt.c:1080 con_install+0x4f/0x400 drivers/tty/vt/vt.c:3215 tty_driver_install_tty drivers/tty/tty_io.c:1226 [inline] tty_init_dev drivers/tty/tty_io.c:1339 [inline] tty_init_dev+0xee/0x450 drivers/tty/tty_io.c:1316 tty_open_by_driver drivers/tty/tty_io.c:1981 [inline] tty_open+0x4b0/0xb00 drivers/tty/tty_io.c:2029 chrdev_open+0x219/0x5c0 fs/char_dev.c:423 do_dentry_open+0x4a8/0x1160 fs/open.c:796 do_last fs/namei.c:3421 [inline] path_openat+0x1031/0x4200 fs/namei.c:3537 do_filp_open+0x1a1/0x280 fs/namei.c:3567 do_sys_open+0x3c0/0x500 fs/open.c:1088 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 8256: set_track mm/kasan/kasan.c:460 [inline] __kasan_slab_free+0xf7/0x140 mm/kasan/kasan.c:521 __cache_free mm/slab.c:3503 [inline] kfree+0xce/0x220 mm/slab.c:3822 vt_disallocate_all+0x293/0x3b0 drivers/tty/vt/vt_ioctl.c:323 vt_ioctl+0xb79/0x2310 drivers/tty/vt/vt_ioctl.c:816 tty_ioctl+0x7a1/0x1420 drivers/tty/tty_io.c:2669 vfs_ioctl fs/ioctl.c:46 [inline] file_ioctl fs/ioctl.c:501 [inline] do_vfs_ioctl+0xcda/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 The buggy address belongs to the object at ffff88808d23f5c0 which belongs to the cache kmalloc-2048 of size 2048 The buggy address is located 264 bytes inside of 2048-byte region [ffff88808d23f5c0, ffff88808d23fdc0) The buggy address belongs to the page: page:ffffea0002348f80 count:1 mapcount:0 mapping:ffff88812c3dcc40 index:0x0 compound_mapcount: 0 flags: 0xfffe0000008100(slab|head) raw: 00fffe0000008100 ffffea0002353588 ffffea0002358088 ffff88812c3dcc40 raw: 0000000000000000 ffff88808d23e4c0 0000000100000003 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88808d23f580: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb ffff88808d23f600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88808d23f680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88808d23f700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88808d23f780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================