[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [for-4.15][PATCH v2 2/5] xen/iommu: Check if the IOMMU was initialized before tearing down



Hi Paul,

On 09/02/2021 20:22, Paul Durrant wrote:
-----Original Message-----
From: Julien Grall <julien@xxxxxxx>
Sent: 09 February 2021 15:28
To: xen-devel@xxxxxxxxxxxxxxxxxxxx
Cc: hongyxia@xxxxxxxxxxxx; iwj@xxxxxxxxxxxxxx; Julien Grall 
<jgrall@xxxxxxxxxx>; Jan Beulich
<jbeulich@xxxxxxxx>; Paul Durrant <paul@xxxxxxx>
Subject: [for-4.15][PATCH v2 2/5] xen/iommu: Check if the IOMMU was initialized 
before tearing down

From: Julien Grall <jgrall@xxxxxxxxxx>

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 <jgrall@xxxxxxxxxx>

Reviewed-by: Paul Durrant <paul@xxxxxxx>

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

Cheers,

--
Julien Grall



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.