Overview
About vulnerability
In the Linux kernel, the following vulnerability has been resolved:
fbcon: Set fb_display[i]->mode to NULL when the mode is released
Recently, we discovered the following issue through syzkaller:
BUG: KASAN: slab-use-after-free in fb_mode_is_equal+0x285/0x2f0
Read of size 4 at addr ff11000001b3c69c by task syz.xxx
…
Call Trace:
Based on experimentation and analysis, during framebuffer unregistration, only the memory of fb_info->modelist is freed, without setting the corresponding fb_display[i]->mode to NULL for the freed modes. This leads to UAF issues during subsequent accesses. Here’s an example of reproduction steps:
- With /dev/fb0 already registered in the system, load a kernel module to register a new device /dev/fb1;
- Set fb1’s mode to the global fb_display[] array (via FBIOPUT_CON2FBMAP);
- Switch console from fb to VGA (to allow normal rmmod of the ko);
- Unload the kernel module, at this point fb1’s modelist is freed, leaving a wild pointer in fb_display[];
- Trigger the bug via system calls through fb0 attempting to delete a mode from fb0.
Add a check in do_unregister_framebuffer(): if the mode to be freed exists in fb_display[], set the corresponding mode pointer to NULL.
Details
- Affected product:
- Ubuntu 20.04 ELS
- Affected packages:
- linux-meta @ 5.4.0 (+1 more)
Fixes
KernelCare state
Live-patch status from KernelCare for each operating system.
| Operating system | Status | Covered kernels |
|---|---|---|
| Amazon Linux 2023 | Planned | — |
| Debian 12 | Released |
32 kernels
|
| Debian 13 | Will Not Fix | — |
| Ubuntu 22.04 | Planned | — |
| Ubuntu 24.04 | Released |
39 kernels
|
| Ubuntu 24.04 AWS | Planned | — |