IOMMU: make domctl handler tolerate NULL domain
authorJan Beulich <jbeulich@suse.com>
Tue, 7 Jun 2022 12:02:30 +0000 (14:02 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 7 Jun 2022 12:02:30 +0000 (14:02 +0200)
commit4cf9a7c7bdb9d544fbac81105bbc1059ba3dd932
tree995b038b685a41bb9803a7bacb559ff2a324c3fd
parenta6c32abd144ec6443c6a433b5a2ac00e2615aa86
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>
master commit: fa4d84e6dd3c3bfd23a525b75a5483d4ce15adbb
master date: 2022-04-26 10:25:54 +0200
xen/drivers/passthrough/iommu.c