fbdev: bitblit: bound-check glyph index in bit_cursor()
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 18c4ef4e765a798b47980555ed665d78b71aeadf · < bc9db0d879c655d5dfd8add32fd60f13e65d132c| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
fbdev: bitblit: bound-check glyph index in bit_cursor()
bit_cursor() fetches the glyph under the cursor with
c = scr_readw(vc_pos); src = vc_font.data + ((c & charmask) * w * height);
where charmask is 0x1ff when vc_hi_font_mask is set. The screen buffer value comes directly from scr_readw() and may be larger than the current font's glyph count.
Syzkaller triggers this via vcs_write(). The Call Trace shows vcs_write() in vc_screen.c writing an arbitrary 16-bit value with writev() to /dev/vcsa, which vcs_write_buf() in vc_screen.c stores via vcs_scr_writew() without checking charcount. The stored value is later read in bit_cursor() in bitblit.c.
When the font is changed from a font with 512 glyphs to a font with 256 glyphs, the screen buffer can retain characters with the high bit set from the previous mode, which could also produce the same out-of-bounds access.
BUG: KASAN: global-out-of-bounds in soft_cursor+0x378/0x6bc drivers/video/fbdev/core/softcursor.c:70 Read of size 16 at addr ffff800086c57970
From the CVE record · Linux
The Linux kernel's fbdev cursor code can read beyond the current font's glyph data when a screen-buffer character exceeds the font's glyph count. A local actor able to write to /dev/vcsa can trigger the issue; stale screen data after a font change can also trigger it. The input does not specify authentication requirements or any additional user interaction.
Anyone running a Linux kernel with the affected fbdev bitblit cursor code should check their kernel; affected versions were not provided.