In the Linux kernel, the following vulnerability has been resolved:
fbmem: Do not delete the mode that is still in use
The execution of fb_delete_videomode() is not based on the result of the
previous fbcon_mode_deleted(). As a result, the mode is directly deleted,
regardless of whether it is still in use, which may cause UAF.
==================================================================BUG: KASAN: use-after-free in fb_mode_is_equal+0x36e/0x5e0 \
drivers/video/fbdev/core/modedb.c:924Read of size 4 at addr ffff88807e0ddb1c by task syz-executor.0/18962
CPU: 2 PID: 18962 Comm: syz-executor.0 Not tainted 5.10.45-rc1+ #3
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS ...
Call Trace:__dump_stacklib/dump_stack.c:77[inline]dump_stack+0x137/0x1belib/dump_stack.c:118print_address_description+0x6c/0x640mm/kasan/report.c:385__kasan_reportmm/kasan/report.c:545[inline]kasan_report+0x13d/0x1e0mm/kasan/report.c:562fb_mode_is_equal+0x36e/0x5e0drivers/video/fbdev/core/modedb.c:924fbcon_mode_deleted+0x16a/0x220drivers/video/fbdev/core/fbcon.c:2746fb_set_var+0x1e1/0xdb0drivers/video/fbdev/core/fbmem.c:975do_fb_ioctl+0x4d9/0x6e0drivers/video/fbdev/core/fbmem.c:1108vfs_ioctlfs/ioctl.c:48[inline]__do_sys_ioctlfs/ioctl.c:753[inline]__se_sys_ioctl+0xfb/0x170fs/ioctl.c:739do_syscall_64+0x2d/0x70arch/x86/entry/common.c:46entry_SYSCALL_64_after_hwframe+0x44/0xa9Freed by task 18960:kasan_save_stackmm/kasan/common.c:48[inline]kasan_set_track+0x3d/0x70mm/kasan/common.c:56kasan_set_free_info+0x17/0x30mm/kasan/generic.c:355__kasan_slab_free+0x108/0x140mm/kasan/common.c:422slab_free_hookmm/slub.c:1541[inline]slab_free_freelist_hook+0xd6/0x1a0mm/slub.c:1574slab_freemm/slub.c:3139[inline]kfree+0xca/0x3d0mm/slub.c:4121fb_delete_videomode+0x56a/0x820drivers/video/fbdev/core/modedb.c:1104fb_set_var+0x1f3/0xdb0drivers/video/fbdev/core/fbmem.c:978do_fb_ioctl+0x4d9/0x6e0drivers/video/fbdev/core/fbmem.c:1108vfs_ioctlfs/ioctl.c:48[inline]__do_sys_ioctlfs/ioctl.c:753[inline]__se_sys_ioctl+0xfb/0x170fs/ioctl.c:739do_syscall_64+0x2d/0x70arch/x86/entry/common.c:46entry_SYSCALL_64_after_hwframe+0x44/0xa9