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:
207a514
)
net/ena/base: initialize memory in the allocation macros
author
Alexander Matushevsky
<matua@amazon.com>
Tue, 4 Jul 2017 13:51:53 +0000
(15:51 +0200)
committer
Ferruh Yigit
<ferruh.yigit@intel.com>
Thu, 6 Jul 2017 13:00:57 +0000
(15:00 +0200)
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 <matua@amazon.com>
Signed-off-by: Michal Krawczyk <mk@semihalf.com>
drivers/net/ena/base/ena_plat_dpdk.h
patch
|
blob
|
history
diff --git
a/drivers/net/ena/base/ena_plat_dpdk.h
b/drivers/net/ena/base/ena_plat_dpdk.h
index
7eaebf4
..
71a8c1e
100644
(file)
--- 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)