IOMMU: make domctl handler tolerate NULL domain
authorJan Beulich <jbeulich@suse.com>
Tue, 26 Apr 2022 08:25:54 +0000 (10:25 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 26 Apr 2022 08:25:54 +0000 (10:25 +0200)
commitfa4d84e6dd3c3bfd23a525b75a5483d4ce15adbb
treef3f966645c9d65926879eff9b423e03d3121b6e5
parent9cd7e31b3f584e97a138a770cfb031a91a867936
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: 71e617a6b8f6 ("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>
xen/drivers/passthrough/iommu.c