[v2] test/mempool: fix heap buffer overflow
Checks
Commit Message
Amount of allocated memory was not enough for mempool
which cause buffer overflow when access fields of mempool
private structure in the rte_pktmbuf_priv_size function.
Fixes: 923ceaeac140 ("test/mempool: add unit test cases")
Cc: stable@dpdk.org
Signed-off-by: Wenwu Ma <wenwux.ma@intel.com>
---
v2:
- refine commit log.
---
app/test/test_mempool.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
@@ -543,7 +543,8 @@ test_mempool(void)
mp_stack_mempool_iter = rte_mempool_create("test_iter_obj",
MEMPOOL_SIZE,
MEMPOOL_ELT_SIZE,
- RTE_MEMPOOL_CACHE_MAX_SIZE, 0,
+ RTE_MEMPOOL_CACHE_MAX_SIZE,
+ sizeof(struct rte_pktmbuf_pool_private),
NULL, NULL,
my_obj_init, NULL,
SOCKET_ID_ANY, 0);