[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220627161123.1386853-1-pgonda@google.com>
Date: Mon, 27 Jun 2022 09:11:23 -0700
From: Peter Gonda <pgonda@...gle.com>
To: kvm@...r.kernel.org
Cc: Peter Gonda <pgonda@...gle.com>, Greg Thelen <gthelen@...gle.com>,
Paolo Bonzini <pbonzini@...hat.com>,
Sean Christopherson <seanjc@...gle.com>,
Tom Lendacky <thomas.lendacky@....com>,
linux-kernel@...r.kernel.org
Subject: [PATCH] KVM: SEV: Clear the pages pointer in sev_unpin_memory
Clear to the @pages array pointer in sev_unpin_memory to avoid leaving a
dangling pointer to invalid memory.
Signed-off-by: Peter Gonda <pgonda@...gle.com>
Cc: Greg Thelen <gthelen@...gle.com>
Cc: Paolo Bonzini <pbonzini@...hat.com>
Cc: Sean Christopherson <seanjc@...gle.com>
Cc: Tom Lendacky <thomas.lendacky@....com>
Cc: kvm@...r.kernel.org
Cc: linux-kernel@...r.kernel.org
---
arch/x86/kvm/svm/sev.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/x86/kvm/svm/sev.c b/arch/x86/kvm/svm/sev.c
index 309bcdb2f929..485ad86c01c6 100644
--- a/arch/x86/kvm/svm/sev.c
+++ b/arch/x86/kvm/svm/sev.c
@@ -452,6 +452,7 @@ static void sev_unpin_memory(struct kvm *kvm, struct page **pages,
unpin_user_pages(pages, npages);
kvfree(pages);
sev->pages_locked -= npages;
+ *pages = NULL;
}
static void sev_clflush_pages(struct page *pages[], unsigned long npages)
--
2.37.0.rc0.161.g10f37bed90-goog
Powered by blists - more mailing lists