Skip to content

Commit

Permalink
x86/amd-iommu: Use helper function to destroy domain
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Joerg Roedel committed Mar 8, 2010
1 parent 3551a70 commit 8b408fe
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions arch/x86/kernel/amd_iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 8b408fe

Please sign in to comment.