================================================================== BUG: KASAN: use-after-free in fb_mode_is_equal+0x36e/0x5e0 drivers/video/fbdev/core/modedb.c:924 Read of size 4 at addr ffff88809e83269c by task syz-executor.0/27057 CPU: 0 PID: 27057 Comm: syz-executor.0 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+0x1d6/0x29e lib/dump_stack.c:118 print_address_description+0x66/0x620 mm/kasan/report.c:383 __kasan_report mm/kasan/report.c:513 [inline] kasan_report+0x132/0x1d0 mm/kasan/report.c:530 fb_mode_is_equal+0x36e/0x5e0 drivers/video/fbdev/core/modedb.c:924 fbcon_mode_deleted+0xe6/0x170 drivers/video/fbdev/core/fbcon.c:2781 fb_set_var+0x1d4/0xc50 drivers/video/fbdev/core/fbmem.c:975 do_fb_ioctl+0x4d9/0x6e0 drivers/video/fbdev/core/fbmem.c:1104 vfs_ioctl fs/ioctl.c:48 [inline] __do_sys_ioctl fs/ioctl.c:753 [inline] __se_sys_ioctl+0xfb/0x170 fs/ioctl.c:739 do_syscall_64+0x31/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:00007fb22fb57c78 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: 00007ffe0208cc2f R14: 00007fb22fb589c0 R15: 000000000118bf2c Allocated by task 8286: kasan_save_stack mm/kasan/common.c:48 [inline] kasan_set_track mm/kasan/common.c:56 [inline] __kasan_kmalloc+0x100/0x130 mm/kasan/common.c:461 kmem_cache_alloc_trace+0x1e4/0x2e0 mm/slab.c:3554 kmalloc include/linux/slab.h:554 [inline] fb_add_videomode+0x6f9/0x810 drivers/video/fbdev/core/modedb.c:1073 fb_set_var+0x685/0xc50 drivers/video/fbdev/core/fbmem.c:1045 do_fb_ioctl+0x4d9/0x6e0 drivers/video/fbdev/core/fbmem.c:1104 vfs_ioctl fs/ioctl.c:48 [inline] __do_sys_ioctl fs/ioctl.c:753 [inline] __se_sys_ioctl+0xfb/0x170 fs/ioctl.c:739 do_syscall_64+0x31/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Freed by task 27046: kasan_save_stack mm/kasan/common.c:48 [inline] kasan_set_track+0x3d/0x70 mm/kasan/common.c:56 kasan_set_free_info+0x17/0x30 mm/kasan/generic.c:355 __kasan_slab_free+0xdd/0x110 mm/kasan/common.c:422 __cache_free mm/slab.c:3422 [inline] kfree+0x113/0x200 mm/slab.c:3760 fb_delete_videomode+0x567/0x810 drivers/video/fbdev/core/modedb.c:1104 fb_set_var+0x1e6/0xc50 drivers/video/fbdev/core/fbmem.c:978 do_fb_ioctl+0x4d9/0x6e0 drivers/video/fbdev/core/fbmem.c:1104 vfs_ioctl fs/ioctl.c:48 [inline] __do_sys_ioctl fs/ioctl.c:753 [inline] __se_sys_ioctl+0xfb/0x170 fs/ioctl.c:739 do_syscall_64+0x31/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 The buggy address belongs to the object at ffff88809e832680 which belongs to the cache kmalloc-96 of size 96 The buggy address is located 28 bytes inside of 96-byte region [ffff88809e832680, ffff88809e8326e0) The buggy address belongs to the page: page:00000000e4bde6ab refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88809e832300 pfn:0x9e832 flags: 0xfffe0000000200(slab) raw: 00fffe0000000200 ffffea0001340848 ffffea0002814208 ffff8880aa440300 raw: ffff88809e832300 ffff88809e832000 000000010000001a 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88809e832580: fa fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc ffff88809e832600: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc >ffff88809e832680: fa fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc ^ ffff88809e832700: 00 00 00 00 00 00 00 00 00 02 fc fc fc fc fc fc ffff88809e832780: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc ==================================================================