DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH v5] eal: out-of-bounds write
@ 2016-06-16 14:52 Slawomir Mrozowicz
  2016-06-20  9:14 ` Thomas Monjalon
  0 siblings, 1 reply; 7+ messages in thread
From: Slawomir Mrozowicz @ 2016-06-16 14:52 UTC (permalink / raw)
  To: david.marchand; +Cc: dev, Slawomir Mrozowicz

Overrunning array mcfg->memseg of 256 44-byte elements
at element index 257 using index j.
Fixed by add condition with message information.

Fixes: af75078fece3 ("first public release")
Coverity ID 13282

Signed-off-by: Slawomir Mrozowicz <slawomirx.mrozowicz@intel.com>
---
v5:
- update message
v4:
- remove check condition from loop
v3:
- add check condition inside and outside the loop
v2:
- add message information
---
 lib/librte_eal/linuxapp/eal/eal_memory.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/lib/librte_eal/linuxapp/eal/eal_memory.c b/lib/librte_eal/linuxapp/eal/eal_memory.c
index 5b9132c..ffe069c 100644
--- a/lib/librte_eal/linuxapp/eal/eal_memory.c
+++ b/lib/librte_eal/linuxapp/eal/eal_memory.c
@@ -1301,6 +1301,14 @@ rte_eal_hugepage_init(void)
 			break;
 		}
 
+	if (j >= RTE_MAX_MEMSEG) {
+		RTE_LOG(ERR, EAL,
+			"All memory segments exhausted by IVSHMEM. "
+			"Try recompiling with larger RTE_MAX_MEMSEG "
+			"then current %d\n", RTE_MAX_MEMSEG);
+		return -ENOMEM;
+	}
+
 	for (i = 0; i < nr_hugefiles; i++) {
 		new_memseg = 0;
 
-- 
1.9.1

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-07-21 12:55 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-16 14:52 [dpdk-dev] [PATCH v5] eal: out-of-bounds write Slawomir Mrozowicz
2016-06-20  9:14 ` Thomas Monjalon
2016-06-20  9:38   ` Sergio Gonzalez Monroy
2016-06-20 10:09     ` Thomas Monjalon
2016-06-20 11:29       ` Sergio Gonzalez Monroy
2016-07-21 12:01         ` Mrozowicz, SlawomirX
2016-07-21 12:54           ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).