CVE-2024-50048
Severity CVSS v4.0:
Pending analysis
Type:
CWE-476
NULL Pointer Dereference
Publication date:
21/10/2024
Last modified:
23/10/2024
Description
In the Linux kernel, the following vulnerability has been resolved:<br />
<br />
fbcon: Fix a NULL pointer dereference issue in fbcon_putcs<br />
<br />
syzbot has found a NULL pointer dereference bug in fbcon.<br />
Here is the simplified C reproducer:<br />
<br />
struct param {<br />
uint8_t type;<br />
struct tiocl_selection ts;<br />
};<br />
<br />
int main()<br />
{<br />
struct fb_con2fbmap con2fb;<br />
struct param param;<br />
<br />
int fd = open("/dev/fb1", 0, 0);<br />
<br />
con2fb.console = 0x19;<br />
con2fb.framebuffer = 0;<br />
ioctl(fd, FBIOPUT_CON2FBMAP, &con2fb);<br />
<br />
param.type = 2;<br />
param.ts.xs = 0; param.ts.ys = 0;<br />
param.ts.xe = 0; param.ts.ye = 0;<br />
param.ts.sel_mode = 0;<br />
<br />
int fd1 = open("/dev/tty1", O_RDWR, 0);<br />
ioctl(fd1, TIOCLINUX, &param);<br />
<br />
con2fb.console = 1;<br />
con2fb.framebuffer = 0;<br />
ioctl(fd, FBIOPUT_CON2FBMAP, &con2fb);<br />
<br />
return 0;<br />
}<br />
<br />
After calling ioctl(fd1, TIOCLINUX, &param), the subsequent ioctl(fd, FBIOPUT_CON2FBMAP, &con2fb)<br />
causes the kernel to follow a different execution path:<br />
<br />
set_con2fb_map<br />
-> con2fb_init_display<br />
-> fbcon_set_disp<br />
-> redraw_screen<br />
-> hide_cursor<br />
-> clear_selection<br />
-> highlight<br />
-> invert_screen<br />
-> do_update_region<br />
-> fbcon_putcs<br />
-> ops->putcs<br />
<br />
Since ops->putcs is a NULL pointer, this leads to a kernel panic.<br />
To prevent this, we need to call set_blitting_type() within set_con2fb_map()<br />
to properly initialize ops->putcs.
Impact
Base Score 3.x
5.50
Severity 3.x
MEDIUM
Vulnerable products and versions
CPE | From | Up to |
---|---|---|
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 6.1.113 (excluding) | |
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 6.2 (including) | 6.6.57 (excluding) |
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 6.7 (including) | 6.11.4 (excluding) |
To consult the complete list of CPE names with products and versions, see this page