From: Michal Krawczyk Subject: [PATCH 2/2] net/ena: initialize memory in the allocation macros Date: Tue, 4 Jul 2017 15:51:53 +0200 Message-ID: <20170704135153.24140-3-mk@semihalf.com> References: <20170704135153.24140-1-mk@semihalf.com> Cc: dev@dpdk.org, Michal Krawczyk To: mw@semihalf.com, gtzalik@amazon.com, matua@amazon.com, evgenys@amazon.com Return-path: Received: from mail-lf0-f46.google.com (mail-lf0-f46.google.com [209.85.215.46]) by dpdk.org (Postfix) with ESMTP id D4270374F for ; Tue, 4 Jul 2017 15:53:31 +0200 (CEST) Received: by mail-lf0-f46.google.com with SMTP id z78so77907025lff.0 for ; Tue, 04 Jul 2017 06:53:31 -0700 (PDT) In-Reply-To: <20170704135153.24140-1-mk@semihalf.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Alexander Matushevsky Uninitialized memory could cause memory corruption, by indicating completion of the invalid mbuf. Fixes: 3d3edc265fc8 ("net/ena: make coherent memory allocation NUMA-aware") 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 7eaebf4..71a8c1e 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.7.4