Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
intel_iommu: Fix address space unmap
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>
Reviewed-by: Peter Xu <peterx@redhat.com>
Message-Id: <20230615032626.314476-4-zhenzhong.duan@intel.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
  • Loading branch information
duanzhenzhong authored and mstsirkin committed Jun 26, 2023
1 parent ce735ff commit ebe1504
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion hw/i386/intel_iommu.c
Expand Up @@ -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);
}

Expand Down

0 comments on commit ebe1504

Please sign in to comment.