lkml.org 
[lkml]   [2020]   [Oct]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 2/2] KVM: X86: Fix null pointer reference for KVM_GET_MSRS
From
Date
On 25/10/20 19:53, Peter Xu wrote:
> kvm_msr_ignored_check() could trigger a null pointer reference if ignore_msrs=Y
> and report_ignore_msrs=Y when try to fetch an invalid feature msr using the
> global KVM_GET_MSRS. Degrade the error report to not rely on vcpu since that
> information (index, rip) is not as important as msr index/data after all.
>
> Fixes: 12bc2132b15e0a96
> Reported-by: Steffen Dirkwinkel <kernel-bugs@steffen.cc>
> Signed-off-by: Peter Xu <peterx@redhat.com>
> ---
> arch/x86/kvm/x86.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
> index ce856e0ece84..5993fbd6d2c5 100644
> --- a/arch/x86/kvm/x86.c
> +++ b/arch/x86/kvm/x86.c
> @@ -259,8 +259,8 @@ static int kvm_msr_ignored_check(struct kvm_vcpu *vcpu, u32 msr,
>
> if (ignore_msrs) {
> if (report_ignored_msrs)
> - vcpu_unimpl(vcpu, "ignored %s: 0x%x data 0x%llx\n",
> - op, msr, data);
> + kvm_pr_unimpl("ignored %s: 0x%x data 0x%llx\n",
> + op, msr, data);
> /* Mask the error */
> return 0;
> } else {
>

I committed Takashi Iwai's very similar patch. Please resend 1/2 with
reviewer comments addressed, thanks!

Paolo

\
 
 \ /
  Last update: 2020-10-31 15:08    [W:0.196 / U:0.196 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site