From: Dmitry Fleytman <dmitry@daynix.com>
To: qemu-devel@nongnu.org
Cc: "Michael S. Tsirkin" <mst@redhat.com>,
mdroth@linux.vnet.ibm.com, qemu-stable@nongnu.org,
Stefan Hajnoczi <stefanha@redhat.com>,
Dmitry Fleytman <dmitry@daynix.com>,
Paolo Bonzini <pbonzini@redhat.com>,
"Dr. David Alan Gilbert" <dgilbert@redhat.com>
Subject: [Qemu-devel] [PATCH V2 2/4] vmxnet3: validate queues configuration coming from quest
Date: Fri, 4 Apr 2014 12:45:20 +0300 [thread overview]
Message-ID: <1396604722-11902-3-git-send-email-dmitry@daynix.com> (raw)
In-Reply-To: <1396604722-11902-1-git-send-email-dmitry@daynix.com>
CVE-2013-4544
Signed-off-by: Dmitry Fleytman <dmitry@daynix.com>
Reported-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
hw/net/vmxnet3.c | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)
diff --git a/hw/net/vmxnet3.c b/hw/net/vmxnet3.c
index 0b317f8..4fefc7b 100644
--- a/hw/net/vmxnet3.c
+++ b/hw/net/vmxnet3.c
@@ -1336,6 +1336,23 @@ static void vmxnet3_validate_interrupts(VMXNET3State *s)
}
}
+static void vmxnet3_validate_queues(VMXNET3State *s)
+{
+ /*
+ * txq_num and rxq_num are total number of queues
+ * configured by guest. These numbers must not
+ * exceed corresponding maximal values.
+ */
+
+ if (s->txq_num > VMXNET3_DEVICE_MAX_TX_QUEUES) {
+ hw_error("Bad TX queues number: %d\n", s->txq_num);
+ }
+
+ if (s->rxq_num > VMXNET3_DEVICE_MAX_RX_QUEUES) {
+ hw_error("Bad RX queues number: %d\n", s->rxq_num);
+ }
+}
+
static void vmxnet3_activate_device(VMXNET3State *s)
{
int i;
@@ -1382,7 +1399,7 @@ static void vmxnet3_activate_device(VMXNET3State *s)
VMXNET3_READ_DRV_SHARED8(s->drv_shmem, devRead.misc.numRxQueues);
VMW_CFPRN("Number of TX/RX queues %u/%u", s->txq_num, s->rxq_num);
- assert(s->txq_num <= VMXNET3_DEVICE_MAX_TX_QUEUES);
+ vmxnet3_validate_queues(s);
qdescr_table_pa =
VMXNET3_READ_DRV_SHARED64(s->drv_shmem, devRead.misc.queueDescPA);
--
1.8.5.3
next prev parent reply other threads:[~2014-04-04 9:46 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-04 9:45 [Qemu-devel] [PATCH V2 0/4] CVE-2013-4544 Dmitry Fleytman
2014-04-04 9:45 ` [Qemu-devel] [PATCH V2 1/4] vmxnet3: validate interrupt indices coming from guest Dmitry Fleytman
2014-04-11 14:05 ` Dr. David Alan Gilbert
2014-04-04 9:45 ` Dmitry Fleytman [this message]
2014-04-11 14:10 ` [Qemu-devel] [PATCH V2 2/4] vmxnet3: validate queues configuration coming from quest Dr. David Alan Gilbert
2014-04-04 9:45 ` [Qemu-devel] [PATCH V2 3/4] vmxnet3: validate interrupt indices read on migration Dmitry Fleytman
2014-04-11 14:21 ` Dr. David Alan Gilbert
2014-04-04 9:45 ` [Qemu-devel] [PATCH V2 4/4] vmxnet3: validate queues configuration " Dmitry Fleytman
2014-04-11 14:23 ` Dr. David Alan Gilbert
2014-04-11 14:26 ` [Qemu-devel] [PATCH V2 0/4] CVE-2013-4544 Dr. David Alan Gilbert
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=1396604722-11902-3-git-send-email-dmitry@daynix.com \
--to=dmitry@daynix.com \
--cc=dgilbert@redhat.com \
--cc=mdroth@linux.vnet.ibm.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-stable@nongnu.org \
--cc=stefanha@redhat.com \
/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).