All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] IOMMU: make domctl handler tolerate NULL domain
@ 2022-04-19  9:39 Jan Beulich
  2022-04-19 10:06 ` Durrant, Paul
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Jan Beulich @ 2022-04-19  9:39 UTC (permalink / raw)
  To: xen-devel; +Cc: Paul Durrant

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>

--- a/xen/drivers/passthrough/iommu.c
+++ b/xen/drivers/passthrough/iommu.c
@@ -558,7 +558,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



^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2022-04-21 19:15 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-19  9:39 [PATCH] IOMMU: make domctl handler tolerate NULL domain Jan Beulich
2022-04-19 10:06 ` Durrant, Paul
2022-04-19 10:08 ` Juergen Gross
2022-04-19 10:49 ` Andrew Cooper
2022-04-19 10:59   ` Jan Beulich
2022-04-19 15:39     ` Andrew Cooper
2022-04-19 16:09       ` Jan Beulich
2022-04-19 15:48 ` Andrew Cooper
2022-04-19 15:52   ` Juergen Gross
2022-04-19 16:06     ` Andrew Cooper
2022-04-20  5:52       ` Jan Beulich
2022-04-21 19:14         ` Andrew Cooper

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.