]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
intel-iommu: Fix leaks in pagetable freeing
authorAlex Williamson <alex.williamson@redhat.com>
Sat, 15 Jun 2013 16:27:19 +0000 (10:27 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 13 Oct 2013 21:51:06 +0000 (14:51 -0700)
commit00dd675556f5c6a17bcba5f7e47c2552daeed84c
tree9c45f1fde364e28bd061ac1265348ade2a381000
parent5b31202a3604ef905d0433402aaf8aadf4660774
intel-iommu: Fix leaks in pagetable freeing

commit 3269ee0bd6686baf86630300d528500ac5b516d7 upstream.

At best the current code only seems to free the leaf pagetables and
the root.  If you're unlucky enough to have a large gap (like any
QEMU guest with more than 3G of memory), only the first chunk of leaf
pagetables are freed (plus the root).  This is a massive memory leak.
This patch re-writes the pagetable freeing function to use a
recursive algorithm and manages to not only free all the pagetables,
but does it without any apparent performance loss versus the current
broken version.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Cc: stable@vger.kernel.org
Reviewed-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Joerg Roedel <joro@8bytes.org>
Signed-off-by: Borislav Petkov <bp@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/pci/intel-iommu.c