]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
iommu/amd: Fix I/O page table memory leak
authorSuravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Thu, 10 Feb 2022 15:47:45 +0000 (09:47 -0600)
committerPaolo Pisati <paolo.pisati@canonical.com>
Wed, 9 Mar 2022 14:17:55 +0000 (15:17 +0100)
commit7a0ab7d9f2ce713e79cb2df204863b4d5730564f
tree5125709c69b7269bed8ef4e686b4ccde41c0eaf1
parent5fb5880e8315b7de90fd07f2732cbbce88daeae4
iommu/amd: Fix I/O page table memory leak

BugLink: https://bugs.launchpad.net/bugs/1964361
[ Upstream commit 6b0b2d9a6a308bcd9300c2d83000a82812c56cea ]

The current logic updates the I/O page table mode for the domain
before calling the logic to free memory used for the page table.
This results in IOMMU page table memory leak, and can be observed
when launching VM w/ pass-through devices.

Fix by freeing the memory used for page table before updating the mode.

Cc: Joerg Roedel <joro@8bytes.org>
Reported-by: Daniel Jordan <daniel.m.jordan@oracle.com>
Tested-by: Daniel Jordan <daniel.m.jordan@oracle.com>
Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Fixes: e42ba0633064 ("iommu/amd: Restructure code for freeing page table")
Link: https://lore.kernel.org/all/20220118194720.urjgi73b7c3tq2o6@oracle.com/
Link: https://lore.kernel.org/r/20220210154745.11524-1-suravee.suthikulpanit@amd.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
drivers/iommu/amd/io_pgtable.c