|
|
9ae3a8 |
From b7dd3cebccd2a785e78aca482f336d0e1500cfc5 Mon Sep 17 00:00:00 2001
|
|
|
9ae3a8 |
From: Michael S. Tsirkin <mst@redhat.com>
|
|
|
9ae3a8 |
Date: Thu, 15 May 2014 09:52:56 +0200
|
|
|
9ae3a8 |
Subject: [PATCH 25/31] usb: fix up post load checks
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
RH-Author: Michael S. Tsirkin <mst@redhat.com>
|
|
|
9ae3a8 |
Message-id: <1400144784-16355-1-git-send-email-mst@redhat.com>
|
|
|
9ae3a8 |
Patchwork-id: 58907
|
|
|
9ae3a8 |
O-Subject: [PATCH qemu-kvm RHEL7.1] usb: fix up post load checks
|
|
|
9ae3a8 |
Bugzilla: 1096829
|
|
|
9ae3a8 |
RH-Acked-by: Gerd Hoffmann <kraxel@redhat.com>
|
|
|
9ae3a8 |
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
|
|
|
9ae3a8 |
RH-Acked-by: Marcel Apfelbaum <marcel.a@redhat.com>
|
|
|
9ae3a8 |
RH-Acked-by: Juan Quintela <quintela@redhat.com>
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Correct post load checks:
|
|
|
9ae3a8 |
1. dev->setup_len == sizeof(dev->data_buf)
|
|
|
9ae3a8 |
seems fine, no need to fail migration
|
|
|
9ae3a8 |
2. When state is DATA, passing index > len
|
|
|
9ae3a8 |
will cause memcpy with negative length,
|
|
|
9ae3a8 |
resulting in heap overflow
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
First of the issues was reported by dgilbert.
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Reported-by: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
|
|
|
9ae3a8 |
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
|
|
|
9ae3a8 |
Signed-off-by: Juan Quintela <quintela@redhat.com>
|
|
|
9ae3a8 |
(cherry picked from commit 719ffe1f5f72b1c7ace4afe9ba2815bcb53a829e)
|
|
|
9ae3a8 |
Note: in maintainer's tree
|
|
|
9ae3a8 |
git://github.com/juanquintela/qemu.git tags/migration/20140515,
|
|
|
9ae3a8 |
pull request sent
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
CVE-2014-3461
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Bugzilla: 1096829
|
|
|
9ae3a8 |
Brew build: http://brewweb.devel.redhat.com/brew/taskinfo?taskID=7459730
|
|
|
9ae3a8 |
Tested: lightly on developer's box
|
|
|
9ae3a8 |
---
|
|
|
9ae3a8 |
hw/usb/bus.c | 4 ++--
|
|
|
9ae3a8 |
1 file changed, 2 insertions(+), 2 deletions(-)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
9ae3a8 |
---
|
|
|
9ae3a8 |
hw/usb/bus.c | 4 ++--
|
|
|
9ae3a8 |
1 files changed, 2 insertions(+), 2 deletions(-)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
diff --git a/hw/usb/bus.c b/hw/usb/bus.c
|
|
|
9ae3a8 |
index 9766b7f..f4eeb5e 100644
|
|
|
9ae3a8 |
--- a/hw/usb/bus.c
|
|
|
9ae3a8 |
+++ b/hw/usb/bus.c
|
|
|
9ae3a8 |
@@ -51,8 +51,8 @@ static int usb_device_post_load(void *opaque, int version_id)
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
if (dev->setup_index < 0 ||
|
|
|
9ae3a8 |
dev->setup_len < 0 ||
|
|
|
9ae3a8 |
- dev->setup_index >= sizeof(dev->data_buf) ||
|
|
|
9ae3a8 |
- dev->setup_len >= sizeof(dev->data_buf)) {
|
|
|
9ae3a8 |
+ dev->setup_index > dev->setup_len ||
|
|
|
9ae3a8 |
+ dev->setup_len > sizeof(dev->data_buf)) {
|
|
|
9ae3a8 |
return -EINVAL;
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
return 0;
|
|
|
9ae3a8 |
--
|
|
|
9ae3a8 |
1.7.1
|
|
|
9ae3a8 |
|