Skip to content

Commit ffed051

Browse files
Li Zheawilliam
authored andcommitted
vfio: remove useless judgement
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 8f0d5bb ("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 <[email protected]> Reviewed-by: Jason Gunthorpe <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alex Williamson <[email protected]>
1 parent d1877e6 commit ffed051

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

drivers/vfio/vfio_iommu_type1.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1377,12 +1377,6 @@ static int vfio_dma_do_unmap(struct vfio_iommu *iommu,
13771377

13781378
if (!iommu->v2 && iova > dma->iova)
13791379
break;
1380-
/*
1381-
* Task with same address space who mapped this iova range is
1382-
* allowed to unmap the iova range.
1383-
*/
1384-
if (dma->task->mm != current->mm)
1385-
break;
13861380

13871381
if (invalidate_vaddr) {
13881382
if (dma->vaddr_invalid) {

0 commit comments

Comments
 (0)