From: Joerg Roedel Date: Mon, 8 Mar 2010 13:20:07 +0000 (+0100) Subject: x86/amd-iommu: Use helper function to destroy domain X-Git-Tag: firefly_0821_release~10186^2~1810 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=0415a7a7068c9cb7d5b34d3a5141a0b87dea8cf7;p=firefly-linux-kernel-4.4.55.git x86/amd-iommu: Use helper function to destroy domain commit 8b408fe4f853dcfa18d133aa4cf1d7546b4c3870 upstream. In the amd_iommu_domain_destroy the protection_domain_free function is partly reimplemented. The 'partly' is the bug here because the domain is not deleted from the domain list. This results in use-after-free errors and data-corruption. Fix it by just using protection_domain_free instead. Signed-off-by: Joerg Roedel Signed-off-by: Greg Kroah-Hartman --- diff --git a/arch/x86/kernel/amd_iommu.c b/arch/x86/kernel/amd_iommu.c index 23fc9fe1625f..c0ebc6351a60 100644 --- a/arch/x86/kernel/amd_iommu.c +++ b/arch/x86/kernel/amd_iommu.c @@ -2239,9 +2239,7 @@ static void amd_iommu_domain_destroy(struct iommu_domain *dom) free_pagetable(domain); - domain_id_free(domain->id); - - kfree(domain); + protection_domain_free(domain); dom->priv = NULL; }