]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: nSVM: Check the value written to MSR_VM_HSAVE_PA
authorVitaly Kuznetsov <vkuznets@redhat.com>
Mon, 28 Jun 2021 10:44:20 +0000 (12:44 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 15 Jul 2021 14:19:43 +0000 (10:19 -0400)
commita3062031c4eae420734ae68de02c1154d7d53e71
treef47973735f964bab3560e1ce527ca1f7b5057d66
parentaf91dd91017d6a85366b9073308c127c474f6294
KVM: nSVM: Check the value written to MSR_VM_HSAVE_PA

APM states that #GP is raised upon write to MSR_VM_HSAVE_PA when
the supplied address is not page-aligned or is outside of "maximum
supported physical address for this implementation".
page_address_valid() check seems suitable. Also, forcefully page-align
the address when it's written from VMM.

Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Message-Id: <20210628104425.391276-2-vkuznets@redhat.com>
Cc: stable@vger.kernel.org
Reviewed-by: Maxim Levitsky <mlevitsk@redhat.com>
[Add comment about behavior for host-provided values. - Paolo]
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/svm/svm.c