fbcon: fix NULL pointer dereference for a console without vc_data
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ d1baa4ffa677bf6986c460fcfd4cdaf8bfe66f0e · < b134ad2f7c06b3c1098dcc95008e2045ff4b49b2| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
fbcon: fix NULL pointer dereference for a console without vc_data
fbcon_new_modelist() runs when a framebuffer's modelist changes. For each console mapped to it with fb_display[i].mode set, it reads vc_cons[i].d and passes the vc_num to fbcon_set_disp(). This assumes a console with a mode set has a vc_data, but it can be NULL. fbcon_set_disp() sets fb_display[i].mode before it checks vc_data, and fbcon_deinit() leaves the mode set after the vc_data is freed. fbcon_new_modelist() then dereferences the NULL vc_data.
Keep fb_display[i].mode set only while the console has a vc_data. Check vc_data before setting the mode in fbcon_set_disp(), and clear the mode in fbcon_deinit(). The existing mode check in fbcon_new_modelist() then skips such consoles.
From the CVE record · Linux
The Linux kernel's framebuffer console code can dereference a NULL pointer when a framebuffer modelist changes and a mapped console has a mode set but no vc_data. The input does not specify how an attacker could trigger this condition or whether access or user interaction is required.
Anyone running the Linux kernel should check whether their build includes the fbcon fix; affected versions are not specified.