Re: [PATCH 2/2] KVM: X86: Fix null pointer reference for KVM_GET_MSRS

2020-10-31 Thread Peter Xu
On Sat, Oct 31, 2020 at 03:06:59PM +0100, Paolo Bonzini wrote: > > 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 *vcp

Re: [PATCH 2/2] KVM: X86: Fix null pointer reference for KVM_GET_MSRS

2020-10-31 Thread Paolo Bonzini
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,

Re: [PATCH 2/2] KVM: X86: Fix null pointer reference for KVM_GET_MSRS

2020-10-26 Thread Vitaly Kuznetsov
Peter Xu writes: > kvm_msr_ignored_check() could trigger a null pointer reference 'dereference' but I'd also clarify that 'vcpu' is NULL. > 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 rel

[PATCH 2/2] KVM: X86: Fix null pointer reference for KVM_GET_MSRS

2020-10-25 Thread Peter Xu
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 af