Re: KVM: x86: use kvm_set_cr3/cr4 in ioctl_set_sregs

2009-04-16 Thread Avi Kivity
Marcelo Tosatti wrote: Matt T. Yourst notes that kvm_arch_vcpu_ioctl_set_sregs lacks validity checking for the new cr3 value: Userspace callers of KVM_SET_SREGS can pass a bogus value of cr3 to the kernel. This will trigger a NULL pointer access in gfn_to_rmap() when userspace next tries to

Re: KVM: x86: use kvm_set_cr3/cr4 in ioctl_set_sregs

2009-04-16 Thread Marcelo Tosatti
On Thu, Apr 16, 2009 at 11:56:15AM +0300, Avi Kivity wrote: Marcelo Tosatti wrote: Matt T. Yourst notes that kvm_arch_vcpu_ioctl_set_sregs lacks validity checking for the new cr3 value: Userspace callers of KVM_SET_SREGS can pass a bogus value of cr3 to the kernel. This will trigger a NULL

Re: KVM: x86: use kvm_set_cr3/cr4 in ioctl_set_sregs

2009-04-16 Thread Avi Kivity
Marcelo Tosatti wrote: Humpf. And something like this? Or GP# instead of triple fault? diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 148cde2..3e63bac 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -3986,7 +3986,10 @@ int kvm_arch_vcpu_ioctl_set_sregs(struct kvm_vcpu

KVM: x86: use kvm_set_cr3/cr4 in ioctl_set_sregs

2009-04-15 Thread Marcelo Tosatti
Matt T. Yourst notes that kvm_arch_vcpu_ioctl_set_sregs lacks validity checking for the new cr3 value: Userspace callers of KVM_SET_SREGS can pass a bogus value of cr3 to the kernel. This will trigger a NULL pointer access in gfn_to_rmap() when userspace next tries to call KVM_RUN on the