]> xenbits.xensource.com Git - qemu-upstream-4.2-testing.git/commit
spice: make sure we don't overflow ssd->buf
authorGerd Hoffmann <kraxel@redhat.com>
Wed, 3 Sep 2014 13:50:08 +0000 (15:50 +0200)
committerStefano Stabellini <stefano.stabellini@eu.citrix.com>
Thu, 5 Mar 2015 13:22:12 +0000 (13:22 +0000)
commit19cba3e719a4d53b91df6008efb969933aa772d1
treeec2f0c432356acfa7febf0071d045ebec214efe1
parent372e797cd3329ca81621220a5df2d6ff4e9e38e6
spice: make sure we don't overflow ssd->buf

Related spice-only bug.  We have a fixed 16 MB buffer here, being
presented to the spice-server as qxl video memory in case spice is
used with a non-qxl card.  It's also used with qxl in vga mode.

When using display resolutions requiring more than 16 MB of memory we
are going to overflow that buffer.  In theory the guest can write,
indirectly via spice-server.  The spice-server clears the memory after
setting a new video mode though, triggering a segfault in the overflow
case, so qemu crashes before the guest has a chance to do something
evil.

Fix that by switching to dynamic allocation for the buffer.

CVE-2014-3615

Cc: qemu-stable@nongnu.org
Cc: secalert@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Conflicts:
ui/spice-display.c
ui/spice-display.c