]> xenbits.xensource.com Git - qemu-upstream-4.6-testing.git/commit
vga: make sure vga register setup for vbe stays intact (CVE-2016-3712).
authorGerd Hoffmann <kraxel@redhat.com>
Tue, 26 Apr 2016 12:48:06 +0000 (14:48 +0200)
committerAnthony PERARD <anthony.perard@citrix.com>
Mon, 9 May 2016 16:42:49 +0000 (17:42 +0100)
commit14a60f98e0cd16e2636afb136129ed7f11cbfce0
treecb0600a54b421799867fc582ce4a23e71695e7bc
parentd90058ab87c36a84c56b2db585de6bdbd1873c9e
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/display/vga.c