DPDK patches and discussions
 help / color / mirror / Atom feed
From: Panu Matilainen <pmatilai@redhat.com>
To: Slawomir Mrozowicz <slawomirx.mrozowicz@intel.com>,
	david.marchand@6wind.com
Cc: dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH v4] eal: out-of-bounds write
Date: Thu, 16 Jun 2016 14:48:58 +0300	[thread overview]
Message-ID: <a9635a3d-dd63-6ef3-7352-5f26e1d00ca1@redhat.com> (raw)
In-Reply-To: <1465997149-10610-1-git-send-email-slawomirx.mrozowicz@intel.com>

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 -

      parent reply	other threads:[~2016-06-16 11:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-15 13:25 Slawomir Mrozowicz
2016-06-16 11:21 ` Sergio Gonzalez Monroy
2016-06-16 11:48 ` Panu Matilainen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a9635a3d-dd63-6ef3-7352-5f26e1d00ca1@redhat.com \
    --to=pmatilai@redhat.com \
    --cc=david.marchand@6wind.com \
    --cc=dev@dpdk.org \
    --cc=slawomirx.mrozowicz@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).