]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
2.6.29 kvm largepage leak fix
authorChris Wright <chrisw@sous-sol.org>
Tue, 31 Mar 2009 21:50:44 +0000 (14:50 -0700)
committerChris Wright <chrisw@sous-sol.org>
Tue, 31 Mar 2009 21:50:44 +0000 (14:50 -0700)
queue-2.6.29/kvm-mmu-fix-another-largepage-memory-leak.patch [new file with mode: 0644]
queue-2.6.29/series

diff --git a/queue-2.6.29/kvm-mmu-fix-another-largepage-memory-leak.patch b/queue-2.6.29/kvm-mmu-fix-another-largepage-memory-leak.patch
new file mode 100644 (file)
index 0000000..e207269
--- /dev/null
@@ -0,0 +1,38 @@
+From stable-bounces@linux.kernel.org  Thu Mar 26 23:05:11 2009
+Date: Thu, 26 Mar 2009 23:05:07 GMT
+Message-Id: <200903262305.n2QN57TC005909@hera.kernel.org>
+From: Joerg Roedel <joerg.roedel@amd.com>
+To: stable@kernel.org
+Subject: KVM: MMU: Fix another largepage memory leak
+
+From: Joerg Roedel <joerg.roedel@amd.com>
+
+upstream commit: c5bc22424021cabda862727fb3f5098b866f074d
+
+In the paging_fetch function rmap_remove is called after setting a large
+pte to non-present. This causes rmap_remove to not drop the reference to
+the large page. The result is a memory leak of that page.
+
+Cc: stable@kernel.org
+Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
+Acked-by: Marcelo Tosatti <mtosatti@redhat.com>
+Signed-off-by: Avi Kivity <avi@redhat.com>
+[chrisw: backport to 2.6.29]
+Signed-off-by: Chris Wright <chrisw@sous-sol.org>
+---
+ arch/x86/kvm/paging_tmpl.h |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/arch/x86/kvm/paging_tmpl.h
++++ b/arch/x86/kvm/paging_tmpl.h
+@@ -314,9 +314,9 @@ static int FNAME(shadow_walk_entry)(stru
+               return 0;
+       if (is_large_pte(*sptep)) {
++              rmap_remove(vcpu->kvm, sptep);
+               set_shadow_pte(sptep, shadow_trap_nonpresent_pte);
+               kvm_flush_remote_tlbs(vcpu->kvm);
+-              rmap_remove(vcpu->kvm, sptep);
+       }
+       if (level == PT_DIRECTORY_LEVEL && gw->level == PT_DIRECTORY_LEVEL) {
index d9c256a8e5c22ab517a4a9f834a4ba64e31e0280..ddb318cbc3b483cabb456cf442e0d8ff69739561 100644 (file)
@@ -42,3 +42,4 @@ vm-x86-pat-change-is_linear_pfn_mapping-to-not-use-vm_pgoff.patch
 lguest-wire-up-pte_update-pte_update_defer.patch
 lguest-fix-spurious-bug_on-on-invalid-guest-stack.patch
 cfg80211-fix-incorrect-assumption-on-last_request-for-11d.patch
+kvm-mmu-fix-another-largepage-memory-leak.patch