[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <BL1PR11MB52711314C2A6E1C55AE694288C8BA@BL1PR11MB5271.namprd11.prod.outlook.com>
Date: Thu, 8 May 2025 09:15:47 +0000
From: "Tian, Kevin" <kevin.tian@...el.com>
To: Nicolin Chen <nicolinc@...dia.com>, Jason Gunthorpe <jgg@...dia.com>
CC: Pranjal Shrivastava <praan@...gle.com>, "corbet@....net" <corbet@....net>,
"will@...nel.org" <will@...nel.org>, "bagasdotme@...il.com"
<bagasdotme@...il.com>, "robin.murphy@....com" <robin.murphy@....com>,
"joro@...tes.org" <joro@...tes.org>, "thierry.reding@...il.com"
<thierry.reding@...il.com>, "vdumpa@...dia.com" <vdumpa@...dia.com>,
"jonathanh@...dia.com" <jonathanh@...dia.com>, "shuah@...nel.org"
<shuah@...nel.org>, "jsnitsel@...hat.com" <jsnitsel@...hat.com>,
"nathan@...nel.org" <nathan@...nel.org>, "peterz@...radead.org"
<peterz@...radead.org>, "Liu, Yi L" <yi.l.liu@...el.com>,
"mshavit@...gle.com" <mshavit@...gle.com>, "zhangzekun11@...wei.com"
<zhangzekun11@...wei.com>, "iommu@...ts.linux.dev" <iommu@...ts.linux.dev>,
"linux-doc@...r.kernel.org" <linux-doc@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>, "linux-tegra@...r.kernel.org"
<linux-tegra@...r.kernel.org>, "linux-kselftest@...r.kernel.org"
<linux-kselftest@...r.kernel.org>, "patches@...ts.linux.dev"
<patches@...ts.linux.dev>, "mochs@...dia.com" <mochs@...dia.com>,
"alok.a.tiwari@...cle.com" <alok.a.tiwari@...cle.com>, "vasant.hegde@....com"
<vasant.hegde@....com>
Subject: RE: [PATCH v2 13/22] iommufd: Add mmap interface
> From: Nicolin Chen <nicolinc@...dia.com>
> Sent: Thursday, May 8, 2025 11:50 AM
>
> On Wed, May 07, 2025 at 07:08:09PM -0300, Jason Gunthorpe wrote:
> > On Wed, May 07, 2025 at 02:09:31PM -0700, Nicolin Chen wrote:
> > > I have another question: while I don't think my code is handling
> > > this well either, how should we validate the input address is an
> > > allowed one?
> >
> > The pgoff to mmap? If it isn't in the maple tree it is not allowed, if
> > it isn't at the start of range it is not allowed, if the size is not
> > exactly the same as the range it is not allowed.
>
> Kevin suggested to allow a partial mmap, i.e allow the size to be
> smaller than what the cookie describes. Yet, surely the mmap size
> should not above the allocated size.
>
let me clarify - I didn't suggested it. Instead it's what the code
does hence I suggested to make it explicit. 😊
Powered by blists - more mailing lists