[dpdk-stable] patch 'vhost: fix malloc size too small' has been queued to stable release 17.05.1

Yuanhan Liu yliu at fridaylinux.org
Tue Jun 20 13:35:46 CEST 2017


Hi,

FYI, your patch has been queued to stable release 17.05.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 06/22/17. So please
shout if anyone has objections.

Thanks.

	--yliu

---
>From ea282f659e2d16c16e47bd033640a96535fce6d8 Mon Sep 17 00:00:00 2001
From: Dariusz Stojaczyk <dariuszx.stojaczyk at intel.com>
Date: Fri, 26 May 2017 13:59:13 +0200
Subject: [PATCH] vhost: fix malloc size too small

[ upstream commit d1b2842a9dcf1e7957a185be126f4af9885f9cf7 ]

Amount of allocated memory was too small, causing buffer overflow.

Fixes: eb32247457fe ("vhost: export guest memory regions")

Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk at intel.com>
Reviewed-by: Jens Freimann <jfreiman at redhat.com>
Acked-by: Yuanhan Liu <yuanhan.liu at linux.intel.com>
---
 lib/librte_vhost/vhost.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/librte_vhost/vhost.c b/lib/librte_vhost/vhost.c
index 0b19d2e..1f565fb 100644
--- a/lib/librte_vhost/vhost.c
+++ b/lib/librte_vhost/vhost.c
@@ -369,7 +369,7 @@ rte_vhost_get_mem_table(int vid, struct rte_vhost_memory **mem)
 		return -1;
 
 	size = dev->mem->nregions * sizeof(struct rte_vhost_mem_region);
-	m = malloc(size);
+	m = malloc(sizeof(struct rte_vhost_memory) + size);
 	if (!m)
 		return -1;
 
-- 
2.7.4



More information about the stable mailing list