================================================================== BUG: KASAN: use-after-free in fb_mode_is_equal+0x284/0x2f0 drivers/video/fbdev/core/modedb.c:924 Read of size 4 at addr ffff888094450b9c by task syz-executor.1/29056 CPU: 1 PID: 29056 Comm: syz-executor.1 Not tainted 5.9.0-rc8-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+0x198/0x1fd 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 fb_mode_is_equal+0x284/0x2f0 drivers/video/fbdev/core/modedb.c:924 fbcon_mode_deleted+0x13d/0x1d0 drivers/video/fbdev/core/fbcon.c:2781 fb_set_var+0xa3f/0xce0 drivers/video/fbdev/core/fbmem.c:975 do_fb_ioctl+0x2f9/0x690 drivers/video/fbdev/core/fbmem.c:1104 fb_ioctl+0xe7/0x150 drivers/video/fbdev/core/fbmem.c:1181 vfs_ioctl fs/ioctl.c:48 [inline] __do_sys_ioctl fs/ioctl.c:753 [inline] __se_sys_ioctl fs/ioctl.c:739 [inline] __x64_sys_ioctl+0x193/0x200 fs/ioctl.c:739 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x45de59 Code: 0d b4 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 db b3 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007f7651c29c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 000000000000e280 RCX: 000000000045de59 RDX: 0000000020000240 RSI: 0000000000004601 RDI: 0000000000000003 RBP: 000000000118bf60 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000118bf2c R13: 000000000169fb7f R14: 00007f7651c2a9c0 R15: 000000000118bf2c Allocated by task 14117: 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 kmem_cache_alloc_trace+0x174/0x300 mm/slab.c:3554 kmalloc include/linux/slab.h:554 [inline] fb_add_videomode drivers/video/fbdev/core/modedb.c:1073 [inline] fb_add_videomode+0x2fb/0x610 drivers/video/fbdev/core/modedb.c:1057 fb_set_var+0x58f/0xce0 drivers/video/fbdev/core/fbmem.c:1045 do_fb_ioctl+0x2f9/0x690 drivers/video/fbdev/core/fbmem.c:1104 fb_ioctl+0xe7/0x150 drivers/video/fbdev/core/fbmem.c:1181 vfs_ioctl fs/ioctl.c:48 [inline] __do_sys_ioctl fs/ioctl.c:753 [inline] __se_sys_ioctl fs/ioctl.c:739 [inline] __x64_sys_ioctl+0x193/0x200 fs/ioctl.c:739 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Freed by task 29041: 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:3422 [inline] kfree+0x10e/0x2b0 mm/slab.c:3760 fb_delete_videomode+0x3d2/0x570 drivers/video/fbdev/core/modedb.c:1104 fb_set_var+0xa4f/0xce0 drivers/video/fbdev/core/fbmem.c:978 do_fb_ioctl+0x2f9/0x690 drivers/video/fbdev/core/fbmem.c:1104 fb_ioctl+0xe7/0x150 drivers/video/fbdev/core/fbmem.c:1181 vfs_ioctl fs/ioctl.c:48 [inline] __do_sys_ioctl fs/ioctl.c:753 [inline] __se_sys_ioctl fs/ioctl.c:739 [inline] __x64_sys_ioctl+0x193/0x200 fs/ioctl.c:739 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 The buggy address belongs to the object at ffff888094450b80 which belongs to the cache kmalloc-96 of size 96 The buggy address is located 28 bytes inside of 96-byte region [ffff888094450b80, ffff888094450be0) The buggy address belongs to the page: page:00000000fbee047f refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x94450 flags: 0xfffe0000000200(slab) raw: 00fffe0000000200 ffffea00029e2a48 ffffea000260cf48 ffff8880aa040300 raw: 0000000000000000 ffff888094450000 0000000100000020 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888094450a80: 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc fc ffff888094450b00: 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc fc >ffff888094450b80: fa fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc ^ ffff888094450c00: 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc fc ffff888094450c80: 00 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc ==================================================================