[lkml]   [2022]   [Jun]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [RFC] vfio: remove useless judgement
On Thu, Jun 23, 2022 at 07:56:03PM +0800, wrote:
> From: Li Zhe <>
> In function vfio_dma_do_unmap(), we currently prevent process to unmap
> vfio dma region whose mm_struct is different from the vfio_dma->task.
> In our virtual machine scenario which is using kvm and qemu, this
> judgement stops us from liveupgrading our qemu, which uses fork() &&
> exec() to load the new binary but the new process cannot do the
> VFIO_IOMMU_UNMAP_DMA action during vm exit because of this judgement.
> This judgement is added in commit 8f0d5bb95f76 ("vfio iommu type1: Add
> task structure to vfio_dma") for the security reason. But it seems that
> no other task who has no family relationship with old and new process
> can get the same vfio_dma struct here for the reason of resource
> isolation. So this patch delete it.
> Signed-off-by: Li Zhe <>
> ---
> drivers/vfio/vfio_iommu_type1.c | 6 ------
> 1 file changed, 6 deletions(-)

I'm inclined to agree with this reasoning and deliberately did not
include a similar check in iommufd. Any process with access to the
container FD should be able to manipulate the IOVA space.

Reviewed-by: Jason Gunthorpe <>


 \ /
  Last update: 2022-06-25 02:14    [W:0.047 / U:3.096 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site