> From: Jason Gunthorpe <[email protected]>
> Sent: Saturday, November 8, 2025 12:50 AM
> 
> Once a DMABUF is revoked the domain will be unmapped under the pages
> mutex. Double unmapping will trigger a WARN, and mapping while revoked
> will fail.
> 
> Check for revoked DMABUFs along all the map and unmap paths to resolve
> this. Ensure that map/unmap is always done under the pages mutex so it is
> synchronized with the revoke notifier.
> 
> If a revoke happens between allocating the iopt_pages and the population
> to a domain then the population will succeed, and leave things unmapped as
> though revoke had happened immediately after.
> 
> Currently there is no way to repopulate the domains. Userspace is expected
> to know if it is going to do something that would trigger revoke (eg if it
> is about to do a FLR) then it should go and remove the DMABUF mappings
> before and put the back after. The revoke is only to protect the kernel
> from mis-behaving userspace.
> 
> Signed-off-by: Jason Gunthorpe <[email protected]>

Reviewed-by: Kevin Tian <[email protected]>

Reply via email to