DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH v4] eal: out-of-bounds write
@ 2016-06-15 13:25 Slawomir Mrozowicz
  2016-06-16 11:21 ` Sergio Gonzalez Monroy
  2016-06-16 11:48 ` Panu Matilainen
  0 siblings, 2 replies; 3+ messages in thread
From: Slawomir Mrozowicz @ 2016-06-15 13:25 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>
---
 lib/librte_eal/linuxapp/eal/eal_memory.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/lib/librte_eal/linuxapp/eal/eal_memory.c b/lib/librte_eal/linuxapp/eal/eal_memory.c
index 5b9132c..19753b1 100644
--- a/lib/librte_eal/linuxapp/eal/eal_memory.c
+++ b/lib/librte_eal/linuxapp/eal/eal_memory.c
@@ -1301,6 +1301,15 @@ rte_eal_hugepage_init(void)
 			break;
 		}
 
+	if (j >= RTE_MAX_MEMSEG) {
+		RTE_LOG(ERR, EAL,
+			"Failed: all memsegs used by ivshmem.\n"
+			"Current %d is not enough.\n"
+			"Please either increase the RTE_MAX_MEMSEG\n",
+			RTE_MAX_MEMSEG);
+		return -ENOMEM;
+	}
+
 	for (i = 0; i < nr_hugefiles; i++) {
 		new_memseg = 0;
 
-- 
1.9.1

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

* Re: [dpdk-dev] [PATCH v4] eal: out-of-bounds write
  2016-06-15 13:25 [dpdk-dev] [PATCH v4] eal: out-of-bounds write Slawomir Mrozowicz
@ 2016-06-16 11:21 ` Sergio Gonzalez Monroy
  2016-06-16 11:48 ` Panu Matilainen
  1 sibling, 0 replies; 3+ messages in thread
From: Sergio Gonzalez Monroy @ 2016-06-16 11:21 UTC (permalink / raw)
  To: Slawomir Mrozowicz, david.marchand; +Cc: dev

On 15/06/2016 14:25, Slawomir Mrozowicz wrote:
> 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>
> ---

Acked-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>

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

* Re: [dpdk-dev] [PATCH v4] eal: out-of-bounds write
  2016-06-15 13:25 [dpdk-dev] [PATCH v4] eal: out-of-bounds write Slawomir Mrozowicz
  2016-06-16 11:21 ` Sergio Gonzalez Monroy
@ 2016-06-16 11:48 ` Panu Matilainen
  1 sibling, 0 replies; 3+ messages in thread
From: Panu Matilainen @ 2016-06-16 11:48 UTC (permalink / raw)
  To: Slawomir Mrozowicz, david.marchand; +Cc: dev

On 06/15/2016 04:25 PM, Slawomir Mrozowicz wrote:
> 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>
> ---
>  lib/librte_eal/linuxapp/eal/eal_memory.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
>
> diff --git a/lib/librte_eal/linuxapp/eal/eal_memory.c b/lib/librte_eal/linuxapp/eal/eal_memory.c
> index 5b9132c..19753b1 100644
> --- a/lib/librte_eal/linuxapp/eal/eal_memory.c
> +++ b/lib/librte_eal/linuxapp/eal/eal_memory.c
> @@ -1301,6 +1301,15 @@ rte_eal_hugepage_init(void)
>  			break;
>  		}
>
> +	if (j >= RTE_MAX_MEMSEG) {
> +		RTE_LOG(ERR, EAL,
> +			"Failed: all memsegs used by ivshmem.\n"
> +			"Current %d is not enough.\n"
> +			"Please either increase the RTE_MAX_MEMSEG\n",
> +			RTE_MAX_MEMSEG);
> +		return -ENOMEM;
> +	}


The error message is either incomplete or not coherent: "please either 
increase..." or what?

Also no need for that "Failed:" because its already prefixed by 
"Error:". I'm not sure how helpful it is to have an error message 
suggest increasing a value that requires recomplication, but maybe 
something more in the lines of:

("All memory segments exhausted by IVSHMEM. Try recompiling with larger 
RTE_MAX_MEMSEG than current %d?", RTE_MAX_MEMSEG)

	- Panu -

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

end of thread, other threads:[~2016-06-16 11:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-15 13:25 [dpdk-dev] [PATCH v4] eal: out-of-bounds write Slawomir Mrozowicz
2016-06-16 11:21 ` Sergio Gonzalez Monroy
2016-06-16 11:48 ` Panu Matilainen

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).