[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 4/5] intel_iommu: Fix address space unmap
From: |
Zhenzhong Duan |
Subject: |
[PATCH v3 4/5] intel_iommu: Fix address space unmap |
Date: |
Thu, 8 Jun 2023 17:52:30 +0800 |
During address space unmap, corresponding IOVA tree entries are
also removed. But DMAMap is set beyond notifier's scope by 1, so
in theory there is possibility to remove a continuous entry above
the notifier's scope but falling in adjacent notifier's scope.
There is no issue currently as no use cases allocate notifiers
continuously, but let's be robust.
Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
---
hw/i386/intel_iommu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c
index f046f8591335..dcc334060cd6 100644
--- a/hw/i386/intel_iommu.c
+++ b/hw/i386/intel_iommu.c
@@ -3791,7 +3791,7 @@ static void vtd_address_space_unmap(VTDAddressSpace *as,
IOMMUNotifier *n)
n->start, size);
map.iova = n->start;
- map.size = size;
+ map.size = size - 1; /* Inclusive */
iova_tree_remove(as->iova_tree, map);
}
--
2.34.1
[PATCH v3 3/5] intel_iommu: Fix flag check in replay, Zhenzhong Duan, 2023/06/08
[PATCH v3 5/5] intel_iommu: Optimize out some unnecessary UNMAP calls, Zhenzhong Duan, 2023/06/08