================================================================== BUG: KASAN: use-after-free in fbcon_cursor+0x57a/0x660 drivers/video/fbdev/core/fbcon.c:1389 Read of size 2 at addr ffff888218921278 by task syz-executor.0/24225 CPU: 1 PID: 24225 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+0x18f/0x20d lib/dump_stack.c:118 print_address_description.constprop.0.cold+0xae/0x497 mm/kasan/report.c:383 __kasan_report mm/kasan/report.c:513 [inline] kasan_report.cold+0x1f/0x37 mm/kasan/report.c:530 fbcon_cursor+0x57a/0x660 drivers/video/fbdev/core/fbcon.c:1389 fbcon_scrolldelta+0x22c/0x1230 drivers/video/fbdev/core/fbcon.c:2887 fbcon_set_origin+0x3c/0x50 drivers/video/fbdev/core/fbcon.c:2938 set_origin+0xe7/0x3e0 drivers/tty/vt/vt.c:930 vc_do_resize+0xb2f/0x1180 drivers/tty/vt/vt.c:1305 fbcon_modechanged+0x36c/0x710 drivers/video/fbdev/core/fbcon.c:2990 fbcon_update_vcs+0x3a/0x50 drivers/video/fbdev/core/fbcon.c:3048 do_fb_ioctl+0x62e/0x690 drivers/video/fbdev/core/fbmem.c:1106 fb_compat_ioctl+0x175/0xc10 drivers/video/fbdev/core/fbmem.c:1311 __do_compat_sys_ioctl+0x1d3/0x230 fs/ioctl.c:842 do_syscall_32_irqs_on arch/x86/entry/common.c:84 [inline] __do_fast_syscall_32+0x57/0x80 arch/x86/entry/common.c:126 do_fast_syscall_32+0x2f/0x70 arch/x86/entry/common.c:149 entry_SYSENTER_compat_after_hwframe+0x4d/0x5c RIP: 0023:0xf7f65549 Code: b8 01 10 06 03 74 b4 01 10 07 03 74 b0 01 10 08 03 74 d8 01 00 00 00 00 00 00 00 00 00 00 00 00 00 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:00000000f555f0cc EFLAGS: 00000296 ORIG_RAX: 0000000000000036 RAX: ffffffffffffffda RBX: 0000000000000004 RCX: 0000000000004601 RDX: 0000000020000200 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 Allocated by task 1: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:48 kasan_set_track mm/kasan/common.c:56 [inline] __kasan_kmalloc.constprop.0+0xbf/0xd0 mm/kasan/common.c:461 __do_kmalloc mm/slab.c:3655 [inline] __kmalloc+0x1a8/0x320 mm/slab.c:3664 kmalloc include/linux/slab.h:559 [inline] kzalloc include/linux/slab.h:666 [inline] vc_do_resize+0x2f6/0x1180 drivers/tty/vt/vt.c:1228 fbcon_init+0x1319/0x1b00 drivers/video/fbdev/core/fbcon.c:1218 visual_init+0x30e/0x5d0 drivers/tty/vt/vt.c:1074 do_bind_con_driver.isra.0+0x549/0x8e0 drivers/tty/vt/vt.c:3657 do_take_over_console+0x423/0x570 drivers/tty/vt/vt.c:4237 do_fbcon_takeover+0x10b/0x210 drivers/video/fbdev/core/fbcon.c:588 fbcon_fb_registered+0x26b/0x340 drivers/video/fbdev/core/fbcon.c:3262 do_register_framebuffer drivers/video/fbdev/core/fbmem.c:1660 [inline] register_framebuffer+0x587/0x980 drivers/video/fbdev/core/fbmem.c:1828 vga16fb_probe+0x6b4/0x7b5 drivers/video/fbdev/vga16fb.c:1373 platform_drv_probe+0x87/0x140 drivers/base/platform.c:747 really_probe+0x282/0x9f0 drivers/base/dd.c:553 driver_probe_device+0xfe/0x1d0 drivers/base/dd.c:738 __device_attach_driver+0x1c2/0x220 drivers/base/dd.c:844 bus_for_each_drv+0x15f/0x1e0 drivers/base/bus.c:431 __device_attach+0x228/0x470 drivers/base/dd.c:912 bus_probe_device+0x1e4/0x290 drivers/base/bus.c:491 device_add+0xb17/0x1c40 drivers/base/core.c:2930 platform_device_add+0x34f/0x6d0 drivers/base/platform.c:597 vga16fb_init+0x152/0x1c8 drivers/video/fbdev/vga16fb.c:1431 do_one_initcall+0x10a/0x7a4 init/main.c:1204 do_initcall_level init/main.c:1277 [inline] do_initcalls init/main.c:1293 [inline] do_basic_setup init/main.c:1313 [inline] kernel_init_freeable+0x59c/0x620 init/main.c:1512 kernel_init+0xd/0x1c0 init/main.c:1402 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:294 Freed by task 24225: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:48 kasan_set_track+0x1c/0x30 mm/kasan/common.c:56 kasan_set_free_info+0x1b/0x30 mm/kasan/generic.c:355 __kasan_slab_free+0xd8/0x120 mm/kasan/common.c:422 __cache_free mm/slab.c:3418 [inline] kfree+0x103/0x2c0 mm/slab.c:3756 vc_do_resize+0xacf/0x1180 drivers/tty/vt/vt.c:1302 fbcon_modechanged+0x36c/0x710 drivers/video/fbdev/core/fbcon.c:2990 fbcon_update_vcs+0x3a/0x50 drivers/video/fbdev/core/fbcon.c:3048 do_fb_ioctl+0x62e/0x690 drivers/video/fbdev/core/fbmem.c:1106 fb_compat_ioctl+0x175/0xc10 drivers/video/fbdev/core/fbmem.c:1311 __do_compat_sys_ioctl+0x1d3/0x230 fs/ioctl.c:842 do_syscall_32_irqs_on arch/x86/entry/common.c:84 [inline] __do_fast_syscall_32+0x57/0x80 arch/x86/entry/common.c:126 do_fast_syscall_32+0x2f/0x70 arch/x86/entry/common.c:149 entry_SYSENTER_compat_after_hwframe+0x4d/0x5c The buggy address belongs to the object at ffff888218920000 which belongs to the cache kmalloc-8k of size 8192 The buggy address is located 4728 bytes inside of 8192-byte region [ffff888218920000, ffff888218922000) The buggy address belongs to the page: page:0000000078141daa refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x218920 head:0000000078141daa order:2 compound_mapcount:0 compound_pincount:0 flags: 0x57ffe0000010200(slab|head) raw: 057ffe0000010200 ffffea00086aba08 ffffea0008619908 ffff8880aa040a00 raw: 0000000000000000 ffff888218920000 0000000100000001 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888218921100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888218921180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888218921200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888218921280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888218921300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================