From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: Gerd Hoffmann <kraxel@redhat.com>
Subject: [Qemu-devel] [PATCH 1/4] usb: sanity check setup_index+setup_len in post_load
Date: Tue, 10 Sep 2013 11:41:10 +0200 [thread overview]
Message-ID: <1378806073-25197-2-git-send-email-kraxel@redhat.com> (raw)
In-Reply-To: <1378806073-25197-1-git-send-email-kraxel@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/usb/bus.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/hw/usb/bus.c b/hw/usb/bus.c
index 82ca6a1..72d5b92 100644
--- a/hw/usb/bus.c
+++ b/hw/usb/bus.c
@@ -47,6 +47,10 @@ static int usb_device_post_load(void *opaque, int version_id)
} else {
dev->attached = 1;
}
+ if (dev->setup_index >= sizeof(dev->data_buf) ||
+ dev->setup_len >= sizeof(dev->data_buf)) {
+ return -EINVAL;
+ }
return 0;
}
--
1.8.3.1
next prev parent reply other threads:[~2013-09-10 9:41 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-10 9:41 [Qemu-devel] [PULL 0/4] usb patch queue Gerd Hoffmann
2013-09-10 9:41 ` Gerd Hoffmann [this message]
2013-09-10 9:41 ` [Qemu-devel] [PATCH 2/4] Preparation for usb-bt-dongle conditional build Gerd Hoffmann
2013-09-10 9:41 ` [Qemu-devel] [PATCH 3/4] Remove dev-bluetooth.c dependency from vl.c Gerd Hoffmann
2013-09-10 9:41 ` [Qemu-devel] [PATCH 4/4] ehci: save device pointer in EHCIState Gerd Hoffmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1378806073-25197-2-git-send-email-kraxel@redhat.com \
--to=kraxel@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).