[PATCH v2 13/22] iommufd: Add mmap interface

Tian, Kevin kevin.tian at intel.com
Thu May 8 02:15:47 PDT 2025


> From: Nicolin Chen <nicolinc at nvidia.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. 😊


More information about the linux-arm-kernel mailing list