================================================================== 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 ffff88802b55731c by task syz-executor.3/5393 CPU: 0 PID: 5393 Comm: syz-executor.3 Not tainted 5.11.0-rc5-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:79 [inline] dump_stack+0x107/0x163 lib/dump_stack.c:120 print_address_description.constprop.0.cold+0x5b/0x2f8 mm/kasan/report.c:230 __kasan_report mm/kasan/report.c:396 [inline] kasan_report.cold+0x79/0xd5 mm/kasan/report.c:413 fb_mode_is_equal+0x284/0x2f0 drivers/video/fbdev/core/modedb.c:924 fbcon_mode_deleted+0x13d/0x1d0 drivers/video/fbdev/core/fbcon.c:2723 fb_set_var+0xae1/0xda0 drivers/video/fbdev/core/fbmem.c:975 do_fb_ioctl+0x2f9/0x690 drivers/video/fbdev/core/fbmem.c:1108 fb_compat_ioctl+0x17e/0x610 drivers/video/fbdev/core/fbmem.c:1309 __do_compat_sys_ioctl+0x1d3/0x230 fs/ioctl.c:842 do_syscall_32_irqs_on arch/x86/entry/common.c:77 [inline] __do_fast_syscall_32+0x56/0x80 arch/x86/entry/common.c:139 do_fast_syscall_32+0x2f/0x70 arch/x86/entry/common.c:164 entry_SYSENTER_compat_after_hwframe+0x4d/0x5c RIP: 0023:0xf7fbf549 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:00000000f55b90cc EFLAGS: 00000296 ORIG_RAX: 0000000000000036 RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000000004601 RDX: 0000000020000580 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 31919: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38 kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:401 [inline] ____kasan_kmalloc.constprop.0+0x82/0xa0 mm/kasan/common.c:429 kmalloc include/linux/slab.h:552 [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+0x631/0xda0 drivers/video/fbdev/core/fbmem.c:1049 do_fb_ioctl+0x2f9/0x690 drivers/video/fbdev/core/fbmem.c:1108 fb_compat_ioctl+0x17e/0x610 drivers/video/fbdev/core/fbmem.c:1309 __do_compat_sys_ioctl+0x1d3/0x230 fs/ioctl.c:842 do_syscall_32_irqs_on arch/x86/entry/common.c:77 [inline] __do_fast_syscall_32+0x56/0x80 arch/x86/entry/common.c:139 do_fast_syscall_32+0x2f/0x70 arch/x86/entry/common.c:164 entry_SYSENTER_compat_after_hwframe+0x4d/0x5c Freed by task 5363: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38 kasan_set_track+0x1c/0x30 mm/kasan/common.c:46 kasan_set_free_info+0x20/0x30 mm/kasan/generic.c:356 ____kasan_slab_free+0xe1/0x110 mm/kasan/common.c:362 kasan_slab_free include/linux/kasan.h:192 [inline] slab_free_hook mm/slub.c:1547 [inline] slab_free_freelist_hook+0x5d/0x150 mm/slub.c:1580 slab_free mm/slub.c:3143 [inline] kfree+0xdb/0x3b0 mm/slub.c:4125 fb_delete_videomode+0x3d2/0x570 drivers/video/fbdev/core/modedb.c:1104 fb_set_var+0xaf1/0xda0 drivers/video/fbdev/core/fbmem.c:978 do_fb_ioctl+0x2f9/0x690 drivers/video/fbdev/core/fbmem.c:1108 fb_compat_ioctl+0x17e/0x610 drivers/video/fbdev/core/fbmem.c:1309 __do_compat_sys_ioctl+0x1d3/0x230 fs/ioctl.c:842 do_syscall_32_irqs_on arch/x86/entry/common.c:77 [inline] __do_fast_syscall_32+0x56/0x80 arch/x86/entry/common.c:139 do_fast_syscall_32+0x2f/0x70 arch/x86/entry/common.c:164 entry_SYSENTER_compat_after_hwframe+0x4d/0x5c The buggy address belongs to the object at ffff88802b557300 which belongs to the cache kmalloc-96 of size 96 The buggy address is located 28 bytes inside of 96-byte region [ffff88802b557300, ffff88802b557360) The buggy address belongs to the page: page:00000000d0817ada refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x2b557 flags: 0xfff00000000200(slab) raw: 00fff00000000200 ffffea0000749600 000000170000000e ffff888010041780 raw: 0000000000000000 0000000000200020 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88802b557200: fa fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc ffff88802b557280: fa fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc >ffff88802b557300: fa fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc ^ ffff88802b557380: 00 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc ffff88802b557400: 00 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc ==================================================================