From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <anatoly.burakov@intel.com>
Received: from mga14.intel.com (mga14.intel.com [192.55.52.115])
 by dpdk.org (Postfix) with ESMTP id E70548E80
 for <dev@dpdk.org>; Tue, 17 Apr 2018 13:14:27 +0200 (CEST)
X-Amp-Result: SKIPPED(no attachment in message)
X-Amp-File-Uploaded: False
Received: from fmsmga004.fm.intel.com ([10.253.24.48])
 by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;
 17 Apr 2018 04:14:26 -0700
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.48,463,1517904000"; d="scan'208";a="46818880"
Received: from aburakov-mobl.ger.corp.intel.com (HELO [10.237.220.128])
 ([10.237.220.128])
 by fmsmga004.fm.intel.com with ESMTP; 17 Apr 2018 04:14:26 -0700
To: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Cc: dev@dpdk.org
References: <20180413155417.29643-1-adrien.mazarguil@6wind.com>
 <20180413183950.17625-1-adrien.mazarguil@6wind.com>
 <20180413183950.17625-2-adrien.mazarguil@6wind.com>
 <e2100a0c-6b06-92e3-e52f-a98da7ef4810@intel.com>
From: "Burakov, Anatoly" <anatoly.burakov@intel.com>
Message-ID: <8624521c-060c-3c22-3e56-d1988b4eeda7@intel.com>
Date: Tue, 17 Apr 2018 12:14:25 +0100
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101
 Thunderbird/52.7.0
MIME-Version: 1.0
In-Reply-To: <e2100a0c-6b06-92e3-e52f-a98da7ef4810@intel.com>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 8bit
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 <dev.dpdk.org>
List-Unsubscribe: <https://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: <https://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Tue, 17 Apr 2018 11:14:28 -0000

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 <anatoly.burakov@intel.com>
>>
>> Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
>>
>> -- 
>>
>> 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 <anatoly.burakov@intel.com>
> 

Still ack, but i think Coverity issues need to be moved to main commit 
message, as opposed to being in patch notes.

-- 
Thanks,
Anatoly