CVE-2026-99305: fbdev: udlfb: don't rebuild the mode list while the framebuffer is in use
In the Linux kernel, the following vulnerability has been resolved:
fbdev: udlfb: don't rebuild the mode list while the framebuffer is in use
dlfbsetupmodes() frees info->modelist with fbdestroymodelist() and rebuilds it, but fbcon holds raw pointers into that list in fbdisplay[i].mode and nothing un-publishes them the way dounregisterframebuffer() and storemodes() do with fbcondeletemodelist(). The function does refuse to install a new mode while the framebuffer has users (dlfb->fbcount != 0), but only after the list is already destroyed. Reached from the 0666 "edid" sysfs attribute, an unprivileged write to /sys/class/graphics/fb0/edid therefore fails with -EINVAL and still leaves every fbdisplay[i].mode dangling; the next console switch reads the freed fbvideomode in fbvideomodetovar().
Test fbcount before touching the list. fbcon takes a reference through fbconopen(), so that condition covers exactly the states in which fbdisplay[] points into the list, and the errno returned to userspace is unchanged.
BUG: KASAN: slab-use-after-free in fbvideomodetovar (drivers/video/fbdev/core/modedb.c:905) Read of size 4 at addr ffff8880107b449c by task kworker/1:1/47 Workqueue: events consolecallback Call Trace: fbvideomodetovar (drivers/video/fbdev/core/modedb.c:905) displaytovar (drivers/video/fbdev/core/fbcon.c:998) fbconswitch (drivers/video/fbdev/core/fbcon.c:2182) redrawscreen (drivers/tty/vt/vt.c:994) completechangeconsole (drivers/tty/vt/vtioctl.c:1141) consolecallback (drivers/tty/vt/vt.c:3358) processonework (kernel/workqueue.c:3396) workerthread (kernel/workqueue.c:3479 kernel/workqueue.c:3560) kthread (kernel/kthread.c:436) retfromfork (arch/x86/kernel/process.c:158) retfromforkasm (arch/x86/entry/entry64.S:245) ... The buggy address is located 28 bytes inside of freed 96-byte region [ffff8880107b4480, ffff8880107b44e0)
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Compensating control
Check fb_count before touching or rebuilding the mode list, and do not rebuild the list while the framebuffer is in use.