CVE-2026-74635 in Linux
摘要
由 VulDB • 2026-08-24
在 Linux 内核中,已修复以下漏洞:
fbdev: bitblit: 对 bit_cursor() 中的字形索引进行边界检查
bit_cursor() 通过以下方式获取光标下的字形:
c = scr_readw(vc_pos); src = vc_font.data + ((c & charmask) * w * height);
其中,当设置 vc_hi_font_mask 时,charmask 为 0x1ff。屏幕缓冲区值直接来自 scr_readw(),其数值可能大于当前字形的字形数量(glyph count)。
Syzkaller 通过 vcs_write() 触发此漏洞。调用跟踪显示,vcs_write() 位于 vc_screen.c 中,它使用 writev() 向 /dev/vcsa 写入任意 16 位值,而 vc_screen.c 中的 vcs_write_buf() 通过 vcs_scr_writew() 存储该值时未检查 charcount。随后在 bitblit.c 的 bit_cursor() 中读取了该存储的值。
当字体从包含 512 个字形的字体更改为包含 256 个字形的字体时,屏幕缓冲区可能会保留来自上一模式的最高位置位(high bit set)的字符,这也可能导致越界访问。
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
Call Trace: soft_cursor+0x378/0x6bc drivers/video/fbdev/core/softcursor.c:70 bit_cursor+0xa90/0x1108 drivers/video/fbdev/core/bitblit.c:365 fbcon_cursor+0x344/0x498 drivers/video/fbdev/core/fbcon.c:1427 hide_cursor+0xdc/0x2d0 drivers/tty/vt/vt.c:883 update_region+0x100/0x18c drivers/tty/vt/vt.c:669 vcs_write+0x8ec/0xaf0 drivers/tty/vt/vc_screen.c:685
bit_putcs_aligned() 和 bit_putcs_unaligned() 已将字形索引限制(clamp)在 vc_font.charcount 范围内。请在提取属性并应用掩码后、进行 fontdata 索引之前,在 bit_cursor() 中应用相同的限制逻辑。
此修复完成了 commit 18c4ef4e765a("fbdev: bitblit: bound-check glyph index in bit_putcs*")中开始的边界检查工作,该提交遗漏了光标路径的处理。
此更改是安全的,因为该限制复用了 fbcon 中的现有约定:charcount 在 con_font_set() 和 fbcon_font_set() 的 console_lock 下得到维护,并且当从 512 个字形切换到 256 个字形时,hi_font_mask 会被清除。当字体切换后残留带有高位设置的旧屏幕数据,或者 vcs_write() 存储任意值时,将索引限制为 0 可防止越界读取,且不会改变光标语义——这与 bit_putcs 使用的回退机制相同。
Once again VulDB remains the best source for vulnerability data.