From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by dpdk.org (Postfix) with ESMTP id 61BA68DA9 for ; Tue, 17 Apr 2018 14:39:29 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id DB54C218E7; Tue, 17 Apr 2018 08:39:28 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Tue, 17 Apr 2018 08:39:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=mesmtp; bh=GJKtXqJX0ycJ0+Hdk+V95eLZuN zhvixQORhI2naNdE4=; b=aVZa837PSzQyY1vnD4AMXx2B6rkUKw5ehxfClB1myz ZgHOUdBu/Hv6cHskdrIPuwuuZWWHMRR6oHxu98Kq1onwe3I4xni3gnutmoKUIlOA 9w9af24TVhCZ7hRtssYCfBmJmtsCMefs+WFB8OEcDhFPOypd1d/HEtZ7ljd6FrKu 0= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=GJKtXq JX0ycJ0+Hdk+V95eLZuNzhvixQORhI2naNdE4=; b=D6neRZS30BQMYFhezonpTB n0ft6C7jUeM/lSIgGTOxVMk9Iaw7aOZOGBKmOWRaLJmz+SQs2eLC4ojHvSe/yTFT K/Ui0EsT0YvPq6TtLXmzAfEKkxWYssPiu67g5Wnvpo32ZO5PoCYO0Fb7uAEfBOaZ /pnP8TyJrNMDYBpbSyy7GC7ROCPrdMOew4nGwrZ5q0hknqAZKvbKNdGFCTb+zSfI 4YtxX+JurMYyRVVb2ZtdZ0yUheZq/J9ouycyYf3SQJ/t6voN6r7enq4GOBMCr4CM oeN8ziajwfIRGQ9fo+PtaGpH3DYHIFGtAMfSHqcA0aHHs6ZCd9V/Xhh7CjpJc/Xw == X-ME-Sender: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 436B3E43A6; Tue, 17 Apr 2018 08:39:28 -0400 (EDT) From: Thomas Monjalon To: Adrien Mazarguil Cc: dev@dpdk.org, "Burakov, Anatoly" Date: Tue, 17 Apr 2018 14:39:27 +0200 Message-ID: <3175682.LQN8HbFZGo@xps> In-Reply-To: <8624521c-060c-3c22-3e56-d1988b4eeda7@intel.com> References: <20180413155417.29643-1-adrien.mazarguil@6wind.com> <8624521c-060c-3c22-3e56-d1988b4eeda7@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH v3 2/2] eal: fix signed integers in fbarray X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Apr 2018 12:39:29 -0000 17/04/2018 13:14, Burakov, Anatoly: > On 14-Apr-18 11:03 AM, Burakov, Anatoly wrote: > > On 13-Apr-18 7:43 PM, Adrien Mazarguil wrote: > >> While debugging startup issues encountered with Clang (see "eal: fix > >> undefined behavior in fbarray"), I noticed that fbarray stores indices, > >> sizes and masks on signed integers involved in bitwise operations. > >> > >> Such operations almost invariably cause undefined behavior with values > >> that > >> cannot be represented by the result type, as is often the case with > >> bit-masks and left-shifts. > >> > >> This patch replaces them with unsigned integers as a safety measure and > >> promotes a few internal variables to larger types for consistency. > >> > >> Fixes: c44d09811b40 ("eal: add shared indexed file-backed array") > >> Cc: Anatoly Burakov > >> > >> Signed-off-by: Adrien Mazarguil > >> > >> > >> v3 changes: > >> > >> - Added INT_MAX upper bound check in fully_validate() as suggested by > >> Anatoly. > >> - Added a sysconf() result check to appease Coverity since > >> calc_data_size() > >> now takes an unsigned page size (Coverity issues 272598 and 272599). > >> > >> v2 changes: > >> > >> Removed unnecessary "(unsigned int)" cast leftovers. > > > > Acked-by: Anatoly Burakov > > > > Still ack, but i think Coverity issues need to be moved to main commit > message, as opposed to being in patch notes. Applied (with Coverity ids added), thanks