]> xenbits.xensource.com Git - qemu-upstream-4.3-testing.git/commit
vga: make sure vga register setup for vbe stays intact (CVE-2016-3712).
authorGerd Hoffmann <kraxel@redhat.com>
Wed, 4 May 2016 16:43:36 +0000 (17:43 +0100)
committerAnthony PERARD <anthony.perard@citrix.com>
Tue, 10 May 2016 10:52:12 +0000 (11:52 +0100)
commitc97c20f71240a538a19cb6b0e598bc1bbd5168f1
treedb5a9b36bef36a43fee7bf239272bd7a3692eb8e
parent5ee8a0795e9656b370e9f67b6acea2f2690a1aca
vga: make sure vga register setup for vbe stays intact (CVE-2016-3712).

Call vbe_update_vgaregs() when the guest touches GFX, SEQ or CRT
registers, to make sure the vga registers will always have the
values needed by vbe mode.  This makes sure the sanity checks
applied by vbe_fixup_regs() are effective.

Without this guests can muck with shift_control, can turn on planar
vga modes or text mode emulation while VBE is active, making qemu
take code paths meant for CGA compatibility, but with the very
large display widths and heigts settable using VBE registers.

Which is good for one or another buffer overflow.  Not that
critical as they typically read overflows happening somewhere
in the display code.  So guests can DoS by crashing qemu with a
segfault, but it is probably not possible to break out of the VM.

upstream-commit-id: fd3c136b3e1482cd0ec7285d6bc2a3e6a62c38d7

Fixes: CVE-2016-3712
Reported-by: Zuozhi Fzz <zuozhi.fzz@alibaba-inc.com>
Reported-by: P J P <ppandit@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Stefano Stabellini <sstabellini@kernel.org>
hw/vga.c