diff options
| author | Paolo Bonzini <pbonzini@redhat.com> | 2022-02-08 19:08:33 -0500 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-05-12 12:25:44 +0200 |
| commit | 9c8474fa3477395e754687b3edb17ca0dfe46d6a (patch) | |
| tree | 782fdd4d39bb822dc23dd03397d59b854e3bef58 /kernel | |
| parent | a474ee5ececc19c764c718c76550c5650e54a3be (diff) | |
KVM: x86/mmu: avoid NULL-pointer dereference on page freeing bugs
[ Upstream commit 9191b8f0745e63edf519e4a54a4aaae1d3d46fbd ]
WARN and bail if KVM attempts to free a root that isn't backed by a shadow
page. KVM allocates a bare page for "special" roots, e.g. when using PAE
paging or shadowing 2/3/4-level page tables with 4/5-level, and so root_hpa
will be valid but won't be backed by a shadow page. It's all too easy to
blindly call mmu_free_root_page() on root_hpa, be nice and WARN instead of
crashing KVM and possibly the kernel.
Reviewed-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'kernel')
0 files changed, 0 insertions, 0 deletions
