From: Oleksandr Tyshchenko Date: Wed, 15 Feb 2017 12:20:01 +0000 (+0000) Subject: IOMMU: always call teardown callback X-Git-Tag: archive/raspbian/4.11.1-1+rpi1~1^2~66^2~2790 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=93e1435290867703c50acad1f54b9208df473562;p=xen.git IOMMU: always call teardown callback There is a possible scenario when (d)->need_iommu remains unset during guest domain execution. For example, when no devices were assigned to it. Taking into account that teardown callback is not called when (d)->need_iommu is unset we might have unreleased resourses after destroying domain. So, always call teardown callback to roll back actions that were performed in init callback. This is XSA-207. Signed-off-by: Oleksandr Tyshchenko Reviewed-by: Jan Beulich Tested-by: Jan Beulich Tested-by: Julien Grall --- diff --git a/xen/drivers/passthrough/iommu.c b/xen/drivers/passthrough/iommu.c index d793f5de1a..5e81813942 100644 --- a/xen/drivers/passthrough/iommu.c +++ b/xen/drivers/passthrough/iommu.c @@ -244,8 +244,7 @@ void iommu_domain_destroy(struct domain *d) if ( !iommu_enabled || !dom_iommu(d)->platform_ops ) return; - if ( need_iommu(d) ) - iommu_teardown(d); + iommu_teardown(d); arch_iommu_domain_destroy(d); }