mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +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>
This commit is contained in:
1 parent
9cd7e31b3f
commit
fa4d84e6dd
1 file changed
+1
-1
@@ -568,7 +568,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
|
||||
|
||||