+ "418396be8013386a81f8d8d89ac0effcf03a64b6": "hw/display/vga: fix text-mode OOB write after a graphics surface switch\n\nvga_draw_text() decides whether the console surface needs a resize from\nits geometry cache, but none of the cache terms observe the graphics\nrenderer having replaced the console surface in between:\n\n- last_width/last_height are shared with vga_draw_graphic(), which\n stores them in pixels while the text path stores characters;\n- last_depth stays 0 for legacy (non-VBE) graphics modes, because\n vga_get_bpp() only reports a depth when VBE is enabled, so the\n \"s->last_depth\" term that normally forces a resize after a graphics\n frame does not fire.\n\nSo a graphics frame that shrinks the console surface (e.g. 80x25\npixels) followed by a text frame with matching character geometry\n(80x25 chars) skips the resize, and the glyph loop then paints\nwidth*cw x height*cheight pixels into the smaller surface, out of\nbounds, with guest-controlled (DAC palette) values, on every display\nrefresh.\n\nSeparate the geometry cache per renderer: text paths (vga_draw_text,\nvga_update_text, and the text handling in vga_invalidate_display /\nvga_common_reset) now only manipulate last_text_{width,height}, in\ncharacters; last_{width,height} become graphics-only, in pixels.\nAdditionally, make the text path compare the pixel size it is about\nto paint against the console surface's actual dimensions. The\nsurface check is the load-bearing term: caches in either unit cannot\nsee the other renderer swapping the surface, the surface can.\n\nFixes: CVE-2026-77913\nResolves: https://gitlab.com/qemu-project/qemu/-/work_items/4215\nCc: qemu-stable@nongnu.org\nSigned-off-by: Warisjeet Singh (sin99xx) <sinxx198@gmail.com>\nMessage-ID: <vga-v3-20260824.sinxx198@gmail.com>"
0 commit comments