Re: [PATCH v2] KVM: VMX: Fix rflags cache during vCPU reset

2017-12-05 Thread Jim Mattson
Sorry; I didn't mean to derail this patch thread. Setting bit 1 of RFLAGS on CPU reset is clearly correct. I was just noting that if syzkaller is complaining about illegal RFLAGS, it's trivial for userspace to set RFLAGS to an illegal value. User space can set all kinds of illegal RFLAGS state...b

Re: [PATCH v2] KVM: VMX: Fix rflags cache during vCPU reset

2017-12-05 Thread Paolo Bonzini
On 05/12/2017 01:53, Wanpeng Li wrote: >> That seems like a convoluted path to produce an illegal RFLAGS value. >> What's to prevent syzkaller from simply clearing bit 1 of RFLAGS with >> the KVM_SET_REGS ioctl? > Yeah, it can happen. Which do you prefer, ioctl fails or | > X86_EFLAGS_FIXED uncondi

Re: [PATCH v2] KVM: VMX: Fix rflags cache during vCPU reset

2017-12-04 Thread Wanpeng Li
2017-12-05 8:28 GMT+08:00 Jim Mattson : > That seems like a convoluted path to produce an illegal RFLAGS value. > What's to prevent syzkaller from simply clearing bit 1 of RFLAGS with > the KVM_SET_REGS ioctl? Yeah, it can happen. Which do you prefer, ioctl fails or | X86_EFLAGS_FIXED unconditiona

Re: [PATCH v2] KVM: VMX: Fix rflags cache during vCPU reset

2017-12-04 Thread Jim Mattson
That seems like a convoluted path to produce an illegal RFLAGS value. What's to prevent syzkaller from simply clearing bit 1 of RFLAGS with the KVM_SET_REGS ioctl? On Mon, Nov 20, 2017 at 4:34 PM, Wanpeng Li wrote: > 2017-11-21 7:09 GMT+08:00 Paolo Bonzini : >> On 20/11/2017 23:52, Wanpeng Li wro

Re: [PATCH v2] KVM: VMX: Fix rflags cache during vCPU reset

2017-11-20 Thread Wanpeng Li
2017-11-21 7:09 GMT+08:00 Paolo Bonzini : > On 20/11/2017 23:52, Wanpeng Li wrote: >> diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c >> index b348920..131fa1c 100644 >> --- a/arch/x86/kvm/vmx.c >> +++ b/arch/x86/kvm/vmx.c >> @@ -5590,6 +5590,7 @@ static void vmx_vcpu_reset(struct kvm_vcpu *vc

Re: [PATCH v2] KVM: VMX: Fix rflags cache during vCPU reset

2017-11-20 Thread Paolo Bonzini
On 20/11/2017 23:52, Wanpeng Li wrote: > diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c > index b348920..131fa1c 100644 > --- a/arch/x86/kvm/vmx.c > +++ b/arch/x86/kvm/vmx.c > @@ -5590,6 +5590,7 @@ static void vmx_vcpu_reset(struct kvm_vcpu *vcpu, bool > init_event) > vmcs_writ

[PATCH v2] KVM: VMX: Fix rflags cache during vCPU reset

2017-11-20 Thread Wanpeng Li
From: Wanpeng Li Reported by syzkaller: *** Guest State *** CR0: actual=0x80010031, shadow=0x6010, gh_mask=fff7 CR4: actual=0x2061, shadow=0x, gh_mask=e8f1 CR3 = 0x2081e000 RSP = 0xfffa