From 2861ea8df0173f047efe2636ef3b9643d4d989bc Mon Sep 17 00:00:00 2001 From: Alexander Matushevsky Date: Tue, 4 Jul 2017 15:51:53 +0200 Subject: [PATCH] net/ena/base: initialize memory in the allocation macros Uninitialized memory could cause memory corruption, by indicating completion of the invalid mbuf. Fixes: 3d3edc265fc8 ("net/ena: make coherent memory allocation NUMA-aware") Cc: stable@dpdk.org Signed-off-by: Alexander Matushevsky Signed-off-by: Michal Krawczyk --- drivers/net/ena/base/ena_plat_dpdk.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/ena/base/ena_plat_dpdk.h b/drivers/net/ena/base/ena_plat_dpdk.h index 7eaebf40f4..71a8c1e220 100644 --- a/drivers/net/ena/base/ena_plat_dpdk.h +++ b/drivers/net/ena/base/ena_plat_dpdk.h @@ -207,6 +207,7 @@ typedef uint64_t dma_addr_t; snprintf(z_name, sizeof(z_name), \ "ena_alloc_%d", ena_alloc_cnt++); \ mz = rte_memzone_reserve(z_name, size, node, 0); \ + memset(mz->addr, 0, size); \ virt = mz->addr; \ phys = mz->phys_addr; \ } while (0) @@ -219,6 +220,7 @@ typedef uint64_t dma_addr_t; snprintf(z_name, sizeof(z_name), \ "ena_alloc_%d", ena_alloc_cnt++); \ mz = rte_memzone_reserve(z_name, size, node, 0); \ + memset(mz->addr, 0, size); \ virt = mz->addr; \ } while (0) -- 2.20.1