git.droids-corp.org
/
dpdk.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
29150b7
)
vhost: fix malloc size too small
author
Dariusz Stojaczyk
<dariuszx.stojaczyk@intel.com>
Fri, 26 May 2017 11:59:13 +0000
(13:59 +0200)
committer
Yuanhan Liu
<yliu@fridaylinux.org>
Fri, 16 Jun 2017 12:04:25 +0000
(14:04 +0200)
Amount of allocated memory was too small, causing buffer overflow.
Fixes:
eb32247457fe
("vhost: export guest memory regions")
Cc: stable@dpdk.org
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-by: Jens Freimann <jfreiman@redhat.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
lib/librte_vhost/vhost.c
patch
|
blob
|
history
diff --git
a/lib/librte_vhost/vhost.c
b/lib/librte_vhost/vhost.c
index
1b8e6bd
..
19c5a43
100644
(file)
--- 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(size
of(struct rte_vhost_memory) + size
);
if (!m)
return -1;