From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 92F4AB424 for ; Thu, 16 Jun 2016 13:49:00 +0200 (CEST) Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E6FF410569; Thu, 16 Jun 2016 11:48:59 +0000 (UTC) Received: from sopuli.koti.laiskiainen.org (vpn1-4-166.ams2.redhat.com [10.36.4.166]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u5GBmwsa024992; Thu, 16 Jun 2016 07:48:59 -0400 To: Slawomir Mrozowicz , david.marchand@6wind.com References: <1465997149-10610-1-git-send-email-slawomirx.mrozowicz@intel.com> Cc: dev@dpdk.org From: Panu Matilainen Message-ID: Date: Thu, 16 Jun 2016 14:48:58 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: <1465997149-10610-1-git-send-email-slawomirx.mrozowicz@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Thu, 16 Jun 2016 11:49:00 +0000 (UTC) Subject: Re: [dpdk-dev] [PATCH v4] eal: out-of-bounds write X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2016 11:49:00 -0000 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 > --- > 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 -