mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
IOMMU: make domctl handler tolerate NULL domain
Besides the reporter's issue of hitting a NULL deref when !CONFIG_GDBSX, XEN_DOMCTL_test_assign_device can legitimately end up having NULL passed here, when the domctl was passed DOMID_INVALID. Fixes:71e617a6b8("use is_iommu_enabled() where appropriate...") Reported-by: Cheyenne Wills <cheyenne.wills@gmail.com> Signed-off-by: Jan Beulich <jbeulich@suse.com> Reviewed-by: Paul Durrant <paul@xen.org> Reviewed-by: Juergen Gross <jgross@suse.com> master commit:fa4d84e6ddmaster date: 2022-04-26 10:25:54 +0200
This commit is contained in:
1 parent
3b1031b3b4
commit
dc798302e7
1 file changed
+1
-1
@@ -515,7 +515,7 @@ int iommu_do_domctl(
|
||||
{
|
||||
int ret = -ENODEV;
|
||||
|
||||
if ( !is_iommu_enabled(d) )
|
||||
if ( !(d ? is_iommu_enabled(d) : iommu_enabled) )
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
#ifdef CONFIG_HAS_PCI
|
||||
|
||||