From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <thomas.monjalon@6wind.com>
Received: from mail-wm0-f54.google.com (mail-wm0-f54.google.com [74.125.82.54])
 by dpdk.org (Postfix) with ESMTP id CA7BD95CD
 for <dev@dpdk.org>; Mon, 20 Jun 2016 11:14:47 +0200 (CEST)
Received: by mail-wm0-f54.google.com with SMTP id r201so52132110wme.1
 for <dev@dpdk.org>; Mon, 20 Jun 2016 02:14:47 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=6wind-com.20150623.gappssmtp.com; s=20150623;
 h=from:to:cc:subject:date:message-id:user-agent:in-reply-to
 :references:mime-version:content-transfer-encoding;
 bh=v2jX2HXCJ9C3dOBQ1LVHJNF/e55dpSrKuondjRcsAI0=;
 b=oc1NaQa3TiTIyvxp0sHKMmzVEDMg09PE4YvjG7RxPpOLaYUPJ04NSOqLZpGw4nSv+W
 vvf/wAjfoJZbBndHcI0jH1Qb7M9LljnB0l/G0lo+0QXrj6x4+oWFjoYkJzxVhTfkfQfb
 IHFVb49wPRMg/rBJHnfWoAGl6vEK03CJma6x/NlSf7hZlKOY2dHJDKKbu6BHSgGdfu0C
 yquVEeKVjIvubzl4xl/a9c5QpWGGDctRAFWtP5YB5lyi8myqkz+kOKhghm9R0xZZxNOt
 qVWeND6baOCQnyJHzw7VXcCKVIV1FTw6iLq9lclAndiegkU0GQ+iRbRoQVy56+2HbzsX
 o49A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20130820;
 h=x-gm-message-state:from:to:cc:subject:date:message-id:user-agent
 :in-reply-to:references:mime-version:content-transfer-encoding;
 bh=v2jX2HXCJ9C3dOBQ1LVHJNF/e55dpSrKuondjRcsAI0=;
 b=JmM7my34beb8orvIk1I7V7IKui9K6W9uhY7scii+WsubBqFICbe6RdH1ZiO/KhPXFF
 ctOWae3NTf+clYSTCfhVeSGps2UV0+4Zfr3HDYHmq6W3pNUMOcnhch4F7dhCdFb0zbxl
 oYSZoG8XUMcwmk9atMFrhIES2pqTUGHBatGKMSTvpxpiKA3wfOXASEJFWfmHlp09kOpj
 Pm1McBXADtOEpNnkHCM/HPdeP03Zbz52fH3T1iN5ySCL8FvkjhPRN6bIX1nFdU9OxGHM
 WWd31UfuhLxMRXFgFdBI4Wtf0KJrKWwjpWqxPqnr0sMMmA6Tol2XabwEDVuNBD8yBeER
 43AQ==
X-Gm-Message-State: ALyK8tK8LgV5Y/RRAdHDUlUMorB1V0tHfnybDoiI3+kQR1x2V+X0uWAkzBpl2sGvqTM5X+ND
X-Received: by 10.28.13.1 with SMTP id 1mr9793818wmn.60.1466414082734;
 Mon, 20 Jun 2016 02:14:42 -0700 (PDT)
Received: from xps13.localnet (184.203.134.77.rev.sfr.net. [77.134.203.184])
 by smtp.gmail.com with ESMTPSA id m5sm2288134wmm.10.2016.06.20.02.14.41
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Mon, 20 Jun 2016 02:14:41 -0700 (PDT)
From: Thomas Monjalon <thomas.monjalon@6wind.com>
To: Slawomir Mrozowicz <slawomirx.mrozowicz@intel.com>
Cc: dev@dpdk.org, david.marchand@6wind.com
Date: Mon, 20 Jun 2016 11:14:41 +0200
Message-ID: <3354397.Tgjzuq1405@xps13>
User-Agent: KMail/4.14.10 (Linux/4.5.4-1-ARCH; KDE/4.14.11; x86_64; ; )
In-Reply-To: <1466088738-16990-1-git-send-email-slawomirx.mrozowicz@intel.com>
References: <1466088738-16990-1-git-send-email-slawomirx.mrozowicz@intel.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 7Bit
Content-Type: text/plain; charset="us-ascii"
Subject: Re: [dpdk-dev] [PATCH v5] 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 <dev.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Mon, 20 Jun 2016 09:14:47 -0000

2016-06-16 16:52, 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

Please use this formatting:
Coverity issue: 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

The changelog is OK.
Please use --in-reply-to when making a new revision to keep them
in the same thread.

> --- 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;
>  		}
>  

No newline needed here. The check is directly related to the
previous loop.

> +	if (j >= RTE_MAX_MEMSEG) {

It is out of the scope of this patch but I REALLY HATE this variable j.
Considering a more meaningful rename would be a nice patch.

> +		RTE_LOG(ERR, EAL,
> +			"All memory segments exhausted by IVSHMEM. "

There is no evidence that it is related to IVSHMEM.
"Not enough memory segments." would be more appropriate.

> +			"Try recompiling with larger RTE_MAX_MEMSEG "
> +			"then current %d\n", RTE_MAX_MEMSEG);

then -> than