From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2F09FA32A4 for ; Fri, 25 Oct 2019 17:41:15 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6B3CF1D440; Fri, 25 Oct 2019 17:41:14 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 96CB81D17E; Fri, 25 Oct 2019 17:41:10 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Oct 2019 08:41:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.68,229,1569308400"; d="scan'208";a="373586953" Received: from aburakov-mobl1.ger.corp.intel.com (HELO [10.237.220.104]) ([10.237.220.104]) by orsmga005.jf.intel.com with ESMTP; 25 Oct 2019 08:41:07 -0700 To: Michal Krawczyk Cc: dev@dpdk.org, igorch@amazon.com, gtzalik@amazon.com, rahul.lakkireddy@chelsio.com, stable@dpdk.org References: <20191024121046.30244-1-mk@semihalf.com> From: "Burakov, Anatoly" Message-ID: <96426c4b-8c2b-b825-dd0a-515497dbcb91@intel.com> Date: Fri, 25 Oct 2019 16:41:07 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <20191024121046.30244-1-mk@semihalf.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH] vfio: fix BAR offset type for 32-bit app 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 24-Oct-19 1:10 PM, Michal Krawczyk wrote: > When 32-bit application is built on 64-bit system it is possible that > the offset of the resource is outside of the 32-bit value. > > The problem with the unsigned long is, that it is 32-bit and not 64-bit > when using armhf compiler. Although the system is returning u64 value, > we are losing it's value if it's higher than 32-bit in the conversion > process. It can further cause mmap to fail due to offset being 0 or to > map not intended memory region. > > To make it more portable, the uint64_t value is now being used for > storing offset instead of unsigned long. The size of being 32-bit seems > to be fine as the 32-bit application won't be able to access bigger > memory and it is further converted to size_t anyway. But for better > readability and to be consistent, it's type was changed to size_t as > well. > > Fixes: 0205f873557c ("vfio: fix overflow of BAR region offset and size") > Cc: rahul.lakkireddy@chelsio.com > Cc: stable@dpdk.org > > Signed-off-by: Michal Krawczyk > --- Acked-by: Anatoly Burakov -- Thanks, Anatoly