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 9BF5EA32A8 for ; Sat, 26 Oct 2019 17:31:46 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 705EF1BF25; Sat, 26 Oct 2019 17:31:46 +0200 (CEST) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) by dpdk.org (Postfix) with ESMTP id D1AC71BEEE for ; Sat, 26 Oct 2019 17:31:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1572103904; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jeWy+XcMoX1PB9ZX4/Y/jcSsPXctsaVZ+wU7ClEcET4=; b=Fq976qJoKNLxBFb+WQNf+4/xeLYFhE+xeN8Yu/06yZURNkWcVDtL8bYZcP91JtpWEnQMbV w8nr9qs8D7kT1DSEMy7W8uAkV2zdgg8rUfEFCmZ34lL1N+TW37Fn/EJDN1R8W80mMwwpT0 eF6BzyNZoqcBUTW9WxIWFUN/TB+IOQY= Received: from mail-ua1-f69.google.com (mail-ua1-f69.google.com [209.85.222.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-17-M6_ySzARMoO3fWj2FPExKA-1; Sat, 26 Oct 2019 11:31:42 -0400 Received: by mail-ua1-f69.google.com with SMTP id q34so1057117uad.13 for ; Sat, 26 Oct 2019 08:31:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=oC4n6pRKLS1Aw2ZzVMWXIF3E31kU9jOfHB8Y6NVeOHM=; b=Z4xxnrP83iz/CzHB1KR9VnHdAUI0jm+phdWYLIypiHBHav6BTNIgXczHEa7rVYHbrL ZlOEMX7DE51vkZ8FT6FPhsPDhpTvXYX/TY1Dhyv3zoQ7D/2DVlxHDPoxVsIHo67jasFT rQJ46h3P/jATQrwhbjeP+IbkTvhHN+QeuWZ5spswpc1ik7BwlQY0GWvGti3k/KzBNRZB EqN1TrARYWJsVERk7+R24ESZ8v74CPcevGaQK3aze0BxtCfdFcj+JsWem4NzDSfnYpVk Bl8BximAQkYhBBsnm+rHzr6AuwasKos//lQr18p1j3RKPrvqAjo4IAPX7Q0Z31W2Yeix Rjag== X-Gm-Message-State: APjAAAW4VN/2jvTPhfEg5Z6yhr4GHCABwV1bGQatQ1nptuQkf4I5dz9z GRaGgqdLZLOs0ccW/UaY5nnwwOpFPfG7FyiUVahMp1St5gFPx673Rvucj3b4t1tKEEWbcsyz4O9 TPA1iNWY8K96kJcKERSiN39U= X-Received: by 2002:ab0:189a:: with SMTP id t26mr4534168uag.87.1572103901724; Sat, 26 Oct 2019 08:31:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqzWYERljP47CSoNU0JJtkUGuBcb58yP7Z/ZTIYAOefJJZon+rPwCab7A4Dri8w7Zv6gATfD6Q6YFXJdHpo2wY0= X-Received: by 2002:ab0:189a:: with SMTP id t26mr4534150uag.87.1572103901391; Sat, 26 Oct 2019 08:31:41 -0700 (PDT) MIME-Version: 1.0 References: <20191024121046.30244-1-mk@semihalf.com> <96426c4b-8c2b-b825-dd0a-515497dbcb91@intel.com> In-Reply-To: <96426c4b-8c2b-b825-dd0a-515497dbcb91@intel.com> From: David Marchand Date: Sat, 26 Oct 2019 17:31:30 +0200 Message-ID: To: Michal Krawczyk Cc: dev , igorch@amazon.com, Guy Tzalik , rahul.lakkireddy@chelsio.com, dpdk stable , "Burakov, Anatoly" X-MC-Unique: M6_ySzARMoO3fWj2FPExKA-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [dpdk-stable] [PATCH] vfio: fix BAR offset type for 32-bit app X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" On Fri, Oct 25, 2019 at 5:41 PM Burakov, Anatoly wrote: > > 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: stable@dpdk.org > > > > Signed-off-by: Michal Krawczyk > > --- > > Acked-by: Anatoly Burakov Applied, thanks. --=20 David Marchand