================================================================== BUG: KASAN: use-after-free in fbcon_cursor+0x8d7/0xc00 drivers/video/fbdev/core/fbcon.c:1389 Read of size 2 at addr ffff88821893928a by task syz-executor.5/12737 CPU: 0 PID: 12737 Comm: syz-executor.5 Not tainted 5.8.0-rc7-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 fbcon_cursor+0x8d7/0xc00 drivers/video/fbdev/core/fbcon.c:1389 fbcon_scrolldelta+0x607/0x11a0 drivers/video/fbdev/core/fbcon.c:2887 fbcon_set_origin+0x2c/0x40 drivers/video/fbdev/core/fbcon.c:2938 set_origin+0x321/0x470 drivers/tty/vt/vt.c:926 vc_do_resize+0xf9c/0x1d00 drivers/tty/vt/vt.c:1300 vt_ioctl+0x3185/0x3ec0 drivers/tty/vt/vt_ioctl.c:901 tty_ioctl+0xee4/0x15c0 drivers/tty/tty_io.c:2656 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:00007fa6304a2c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 000000000001c300 RCX: 000000000045cce9 RDX: 0000000020000040 RSI: 000000000000560a RDI: 0000000000000004 RBP: 000000000078bf40 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000078bf0c R13: 00007ffd27a45c1f R14: 00007fa6304a39c0 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+0x1d/0x40 include/linux/slab.h:669 vc_do_resize+0x29a/0x1d00 drivers/tty/vt/vt.c:1223 fbcon_init+0x119e/0x1e60 drivers/video/fbdev/core/fbcon.c:1218 visual_init+0x2b4/0x570 drivers/tty/vt/vt.c:1069 do_bind_con_driver+0x887/0x1370 drivers/tty/vt/vt.c:3573 do_take_over_console+0x5aa/0x730 drivers/tty/vt/vt.c:4153 do_fbcon_takeover drivers/video/fbdev/core/fbcon.c:588 [inline] fbcon_fb_registered+0x36f/0x650 drivers/video/fbdev/core/fbcon.c:3262 do_register_framebuffer drivers/video/fbdev/core/fbmem.c:1664 [inline] register_framebuffer+0x6d6/0x950 drivers/video/fbdev/core/fbmem.c:1832 vga16fb_probe+0x69f/0xa20 drivers/video/fbdev/vga16fb.c:1373 platform_drv_probe+0xcd/0x150 drivers/base/platform.c:747 really_probe+0x763/0xf60 drivers/base/dd.c:524 driver_probe_device+0x106/0x1a0 drivers/base/dd.c:696 bus_for_each_drv+0x108/0x170 drivers/base/bus.c:431 __device_attach+0x20c/0x3a0 drivers/base/dd.c:868 bus_probe_device+0xb8/0x1f0 drivers/base/bus.c:491 device_add+0x1694/0x1a10 drivers/base/core.c:2700 platform_device_add+0x4ad/0x6e0 drivers/base/platform.c:597 vga16fb_init+0xee/0x13e drivers/video/fbdev/vga16fb.c:1431 do_one_initcall+0x14b/0x350 init/main.c:1199 do_initcall_level+0x101/0x14c init/main.c:1272 do_initcalls+0x59/0x9b init/main.c:1288 kernel_init_freeable+0x2ff/0x41f init/main.c:1505 kernel_init+0xd/0x290 init/main.c:1399 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:293 Freed by task 12737: 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 vc_do_resize+0xf55/0x1d00 drivers/tty/vt/vt.c:1297 vt_ioctl+0x3185/0x3ec0 drivers/tty/vt/vt_ioctl.c:901 tty_ioctl+0xee4/0x15c0 drivers/tty/tty_io.c:2656 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 The buggy address belongs to the object at ffff888218938000 which belongs to the cache kmalloc-8k of size 8192 The buggy address is located 4746 bytes inside of 8192-byte region [ffff888218938000, ffff88821893a000) The buggy address belongs to the page: page:ffffea0008624e00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 head:ffffea0008624e00 order:2 compound_mapcount:0 compound_pincount:0 flags: 0x57ffe0000010200(slab|head) raw: 057ffe0000010200 ffffea00086ae208 ffffea0008603a08 ffff8880aa4021c0 raw: 0000000000000000 ffff888218938000 0000000100000001 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888218939180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888218939200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888218939280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888218939300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888218939380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================