]> xenbits.xensource.com Git - qemu-upstream-4.6-testing.git/commit
vga: fix banked access bounds checking (CVE-2016-3710)
authorGerd Hoffmann <kraxel@redhat.com>
Tue, 26 Apr 2016 06:49:10 +0000 (08:49 +0200)
committerAnthony PERARD <anthony.perard@citrix.com>
Mon, 9 May 2016 16:41:20 +0000 (17:41 +0100)
commit96c04bb7e436254db27b6fa0b288c6fc154c6f14
tree8cbb2e4948df4800191b379f0aa4b34e5d104ea0
parent62936f64308aae81530b1273ad2c248b6476e62e
vga: fix banked access bounds checking (CVE-2016-3710)

vga allows banked access to video memory using the window at 0xa00000
and it supports a different access modes with different address
calculations.

The VBE bochs extentions support banked access too, using the
VBE_DISPI_INDEX_BANK register.  The code tries to take the different
address calculations into account and applies different limits to
VBE_DISPI_INDEX_BANK depending on the current access mode.

Which is probably effective in stopping misprogramming by accident.
But from a security point of view completely useless as an attacker
can easily change access modes after setting the bank register.

Drop the bogus check, add range checks to vga_mem_{readb,writeb}
instead.

upstream-commit-id: 3bf1817079bb0d80c0d8a86a7c7dd0bfe90eb82e

Fixes: CVE-2016-3710
Reported-by: Qinghao Tang <luodalongde@gmail.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Stefano Stabellini <sstabellini@kernel.org>
hw/display/vga.c