Hi Paul,

On 09/02/2021 20:22, Paul Durrant wrote:
-----Original Message-----
From: Julien Grall <jul...@xen.org>
Sent: 09 February 2021 15:28
To: xen-devel@lists.xenproject.org
Cc: hongy...@amazon.co.uk; i...@xenproject.org; Julien Grall 
<jgr...@amazon.com>; Jan Beulich
<jbeul...@suse.com>; Paul Durrant <p...@xen.org>
Subject: [for-4.15][PATCH v2 2/5] xen/iommu: Check if the IOMMU was initialized 
before tearing down

From: Julien Grall <jgr...@amazon.com>

is_iommu_enabled() will return true even if the IOMMU has not been
initialized (e.g. the ops are not set).

In the case of an early failure in arch_domain_init(), the function
iommu_destroy_domain() will be called even if the IOMMU is not
initialized.

This will result to dereference the ops which will be NULL and an host
crash.

Fix the issue by checking that ops has been set before accessing it.

Fixes: 71e617a6b8f6 ("use is_iommu_enabled() where appropriate...")
Signed-off-by: Julien Grall <jgr...@amazon.com>

Reviewed-by: Paul Durrant <p...@xen.org>

Thanks! Ian gave his Release-Acked-by so I will commit this patch now.

Cheers,

--
Julien Grall

Reply via email to