x86/amd-iommu: Use helper function to destroy domain

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Thursday, April 15, 2010 - 1:59 pm

Gitweb:     http://git.kernel.org/linus/8b408fe4f853dcfa18d133aa4cf1d7546b4c3870
Commit:     8b408fe4f853dcfa18d133aa4cf1d7546b4c3870
Parent:     3551a708f35fc712af43aeb7f541512c5cfc4936
Author:     Joerg Roedel <joerg.roedel@amd.com>
AuthorDate: Mon Mar 8 14:20:07 2010 +0100
Committer:  Joerg Roedel <joerg.roedel@amd.com>
CommitDate: Mon Mar 8 14:20:07 2010 +0100

    x86/amd-iommu: Use helper function to destroy domain
    
    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.
    
    Cc: stable@kernel.org
    Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
---
 arch/x86/kernel/amd_iommu.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/arch/x86/kernel/amd_iommu.c b/arch/x86/kernel/amd_iommu.c
index 0c04254..b06f29e 100644
--- a/arch/x86/kernel/amd_iommu.c
+++ b/arch/x86/kernel/amd_iommu.c
@@ -2380,9 +2380,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;
 }
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
x86/amd-iommu: Use helper function to destroy domain, Linux Kernel Mailing ..., (Thu Apr 15, 1:59 pm)