diff mbox series

[v12,72/84] KVM: PPC: Remove extra get_page() to fix page refcount leak

Message ID 20240726235234.228822-73-seanjc@google.com (mailing list archive)
State Handled Elsewhere, archived
Headers show
Series KVM: Stop grabbing references to PFNMAP'd pages | expand

Checks

Context Check Description
conchuod/vmtest-fixes-PR fail merge-conflict
conchuod/vmtest-for-next-PR fail PR summary
conchuod/patch-72-test-1 success .github/scripts/patches/tests/build_rv32_defconfig.sh
conchuod/patch-72-test-2 success .github/scripts/patches/tests/build_rv64_clang_allmodconfig.sh
conchuod/patch-72-test-3 success .github/scripts/patches/tests/build_rv64_gcc_allmodconfig.sh
conchuod/patch-72-test-4 success .github/scripts/patches/tests/build_rv64_nommu_k210_defconfig.sh
conchuod/patch-72-test-5 success .github/scripts/patches/tests/build_rv64_nommu_virt_defconfig.sh
conchuod/patch-72-test-6 success .github/scripts/patches/tests/checkpatch.sh
conchuod/patch-72-test-7 success .github/scripts/patches/tests/dtb_warn_rv64.sh
conchuod/patch-72-test-8 success .github/scripts/patches/tests/header_inline.sh
conchuod/patch-72-test-9 success .github/scripts/patches/tests/kdoc.sh
conchuod/patch-72-test-10 success .github/scripts/patches/tests/module_param.sh
conchuod/patch-72-test-11 success .github/scripts/patches/tests/verify_fixes.sh
conchuod/patch-72-test-12 success .github/scripts/patches/tests/verify_signedoff.sh

Commit Message

Sean Christopherson July 26, 2024, 11:52 p.m. UTC
Don't manually do get_page() when patching dcbz, as gfn_to_page() gifts
the caller a reference.  I.e. doing get_page() will leak the page due to
not putting all references.

Signed-off-by: Sean Christopherson <seanjc@google.com>
---
 arch/powerpc/kvm/book3s_pr.c | 1 -
 1 file changed, 1 deletion(-)
diff mbox series

Patch

diff --git a/arch/powerpc/kvm/book3s_pr.c b/arch/powerpc/kvm/book3s_pr.c
index 1bdcd4ee4813..ae4757ac0848 100644
--- a/arch/powerpc/kvm/book3s_pr.c
+++ b/arch/powerpc/kvm/book3s_pr.c
@@ -652,7 +652,6 @@  static void kvmppc_patch_dcbz(struct kvm_vcpu *vcpu, struct kvmppc_pte *pte)
 	hpage_offset &= ~0xFFFULL;
 	hpage_offset /= 4;
 
-	get_page(hpage);
 	page = kmap_atomic(hpage);
 
 	/* patch dcbz into reserved instruction, so we trap */