patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Ferruh Yigit <>
Cc: Ferruh Yigit <>,
	Maxime Coquelin <>,
	Ilja Van Sprundel <>,
	Xiaolong Ye <>
Subject: [dpdk-stable] [PATCH v19.11 1/6] vhost: check log mmap offset and size overflow
Date: Mon, 18 May 2020 14:19:08 +0100
Message-ID: <> (raw)
In-Reply-To: <>

From: Maxime Coquelin <>

vhost_user_set_log_base() is a message handler that is
called to handle the VHOST_USER_SET_LOG_BASE message.
Its payload contains a 64 bit size and offset. Both are
added up and used as a size when calling mmap().

There is no integer overflow check. If an integer overflow
occurs a smaller memory map would be created than
requested. Since the returned mapping is mapped as writable
and used for logging, a memory corruption could occur.

Fixes: fbc4d248b198 ("vhost: fix offset while mmaping log base address")

This issue has been assigned CVE-2020-10722

Reported-by: Ilja Van Sprundel <>
Signed-off-by: Maxime Coquelin <>
Reviewed-by: Xiaolong Ye <>
Reviewed-by: Ilja Van Sprundel <>
 lib/librte_vhost/vhost_user.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c
index 40c4520c08..02962fcdbc 100644
--- a/lib/librte_vhost/vhost_user.c
+++ b/lib/librte_vhost/vhost_user.c
@@ -2059,10 +2059,10 @@ vhost_user_set_log_base(struct virtio_net **pdev, struct VhostUserMsg *msg,
 	size = msg->payload.log.mmap_size;
 	off  = msg->payload.log.mmap_offset;
-	/* Don't allow mmap_offset to point outside the mmap region */
-	if (off > size) {
+	/* Check for mmap size and offset overflow. */
+	if (off >= -size) {
-			"log offset %#"PRIx64" exceeds log size %#"PRIx64"\n",
+			"log offset %#"PRIx64" and log size %#"PRIx64" overflow\n",
 			off, size);

  reply	other threads:[~2020-05-18 13:19 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-18 13:19 [dpdk-stable] [PATCH v19.11 0/6] Fix vhost security issues Ferruh Yigit
2020-05-18 13:19 ` Ferruh Yigit [this message]
2020-05-18 13:19 ` [dpdk-stable] [PATCH v19.11 2/6] vhost: fix vring index check Ferruh Yigit
2020-05-18 13:19 ` [dpdk-stable] [PATCH v19.11 3/6] vhost/crypto: validate keys lengths Ferruh Yigit
2020-05-18 13:19 ` [dpdk-stable] [PATCH v19.11 4/6] vhost: fix translated address not checked Ferruh Yigit
2020-05-18 13:19 ` [dpdk-stable] [PATCH v19.11 5/6] vhost: fix potential memory space leak Ferruh Yigit
2020-05-18 13:19 ` [dpdk-stable] [PATCH v19.11 6/6] vhost: fix potential fd leak Ferruh Yigit

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

patches for DPDK stable branches

This inbox may be cloned and mirrored by anyone:

	git clone --mirror stable/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 stable stable/ \
	public-inbox-index stable

Example config snippet for mirrors.
Newsgroup available over NNTP:

AGPL code for this site: git clone