Re: [PATCH] iommufd: reject mapping an iommufd file into an IOAS

From: Jason Gunthorpe

Date: Mon Nov 16 2026 - 08:49:28 EST


On Mon, Nov 16, 2026 at 11:38:08AM +0800, Jiahao Xu wrote:
> Agreed -- the blocklist is the wrong direction. A vfio device fd bound to
> this iommufd holds an iommufd_ctx reference of its own, so it reaches the
> same cycle, and any other fd type that can own an iommufd_ctx would too.
>
> The reversal looks doable with what mm already enforces. memfd_pin_folios()
> accepts only these two kinds of file:
>
> if (!shmem_file(memfd) && !is_file_hugepages(memfd))
> return -EINVAL;

And how do you let dmabuf go through?

Jason