e2a042f066
Fix CVE-2013-4148 (bnc#864812), CVE-2013-4149 (bnc#864649), CVE-2013-4150 (bnc#864650), CVE-2013-4151 (bnc#864653), CVE-2013-4526 (bnc#864671), CVE-2013-4527 (bnc#864673), CVE-2013-4529 (bnc#864678), CVE-2013-4530 (bnc#864682), CVE-2013-4531 (bnc#864796), CVE-2013-4533 (bnc#864655), CVE-2013-4534 (bnc#864811), CVE-2013-4535 / CVE-2013-4536 (bnc#864665), CVE-2013-4537 (bnc#864391), CVE-2013-4538 (bnc#864769), CVE-2013-4539 (bnc#864805), CVE-2013-4540 (bnc#864801), CVE-2013-4541 (bnc#864802), CVE-2013-4542 (bnc#864804), CVE-2013-6399 (bnc#864814), CVE-2014-0182 (bnc#874788) OBS-URL: https://build.opensuse.org/request/show/235280 OBS-URL: https://build.opensuse.org/package/show/Virtualization/qemu?expand=0&rev=211
57 lines
1.9 KiB
Diff
57 lines
1.9 KiB
Diff
From f1cebceb572956ff820ecc29362c6ade0020d570 Mon Sep 17 00:00:00 2001
|
|
From: "Michael S. Tsirkin" <mst@redhat.com>
|
|
Date: Thu, 3 Apr 2014 19:51:57 +0300
|
|
Subject: [PATCH] pxa2xx: avoid buffer overrun on incoming migration
|
|
MIME-Version: 1.0
|
|
Content-Type: text/plain; charset=UTF-8
|
|
Content-Transfer-Encoding: 8bit
|
|
|
|
CVE-2013-4533
|
|
|
|
s->rx_level is read from the wire and used to determine how many bytes
|
|
to subsequently read into s->rx_fifo[]. If s->rx_level exceeds the
|
|
length of s->rx_fifo[] the buffer can be overrun with arbitrary data
|
|
from the wire.
|
|
|
|
Fix this by validating rx_level against the size of s->rx_fifo.
|
|
|
|
Cc: Don Koch <dkoch@verizon.com>
|
|
Reported-by: Michael Roth <mdroth@linux.vnet.ibm.com>
|
|
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
|
|
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
|
|
Reviewed-by: Don Koch <dkoch@verizon.com>
|
|
Signed-off-by: Juan Quintela <quintela@redhat.com>
|
|
(cherry picked from commit caa881abe0e01f9931125a0977ec33c5343e4aa7)
|
|
[AF: BNC#864655]
|
|
Signed-off-by: Andreas Färber <afaerber@suse.de>
|
|
---
|
|
hw/arm/pxa2xx.c | 8 ++++++--
|
|
1 file changed, 6 insertions(+), 2 deletions(-)
|
|
|
|
diff --git a/hw/arm/pxa2xx.c b/hw/arm/pxa2xx.c
|
|
index 0429148..e0cd847 100644
|
|
--- a/hw/arm/pxa2xx.c
|
|
+++ b/hw/arm/pxa2xx.c
|
|
@@ -732,7 +732,7 @@ static void pxa2xx_ssp_save(QEMUFile *f, void *opaque)
|
|
static int pxa2xx_ssp_load(QEMUFile *f, void *opaque, int version_id)
|
|
{
|
|
PXA2xxSSPState *s = (PXA2xxSSPState *) opaque;
|
|
- int i;
|
|
+ int i, v;
|
|
|
|
s->enable = qemu_get_be32(f);
|
|
|
|
@@ -746,7 +746,11 @@ static int pxa2xx_ssp_load(QEMUFile *f, void *opaque, int version_id)
|
|
qemu_get_8s(f, &s->ssrsa);
|
|
qemu_get_8s(f, &s->ssacd);
|
|
|
|
- s->rx_level = qemu_get_byte(f);
|
|
+ v = qemu_get_byte(f);
|
|
+ if (v < 0 || v > ARRAY_SIZE(s->rx_fifo)) {
|
|
+ return -EINVAL;
|
|
+ }
|
|
+ s->rx_level = v;
|
|
s->rx_start = 0;
|
|
for (i = 0; i < s->rx_level; i ++)
|
|
s->rx_fifo[i] = qemu_get_byte(f);
|