func: int CVE_2009_2287_PATCHED_kvm_arch_vcpu_ioctl_set_sregs(struct kvm_vcpu struct kvm_sregs *sregs) vcpu -> arch . cr2 = sregs -> cr2; if ( gfn_to_memslot ( vcpu -> kvm , sregs -> cr3 >> PAGE_SHIFT ) )  vcpu -> arch . cr3 = sregs -> cr3; vcpu -> arch . cr0 = sregs -> cr0; if ( ! irqchip_in_kernel ( vcpu -> kvm ) )  memcpy ( vcpu -> arch . irq_pending , sregs -> interrupt_bitmap , sizeof vcpu -> arch . irq_pending ); vcpu -> arch . irq_summary = 0; for (i = 0; i < ARRAY_SIZE(vcpu->arch.irq_pending); ++i) if ( vcpu -> arch . irq_pending [ i ] )  __set_bit ( i , & vcpu -> arch . irq_summary ); kvm_set_segment ( vcpu , & sregs -> cs , VCPU_SREG_CS ); kvm_set_segment ( vcpu , & sregs -> ds , VCPU_SREG_DS ); kvm_set_segment ( vcpu , & sregs -> es , VCPU_SREG_ES ); kvm_set_segment ( vcpu , & sregs -> fs , VCPU_SREG_FS ); kvm_set_segment ( vcpu , & sregs -> gs , VCPU_SREG_GS ); kvm_set_segment ( vcpu , & sregs -> ss , VCPU_SREG_SS ); kvm_set_segment ( vcpu , & sregs -> tr , VCPU_SREG_TR ); kvm_set_segment ( vcpu , & sregs -> ldt , VCPU_SREG_LDTR ); if ( vcpu -> vcpu_id == 0 && kvm_rip_read ( vcpu ) == 0xfff0 && sregs -> cs . selector == 0xf000 && sregs -> cs . base == 0xffff0000 && ! ( vcpu -> arch . cr0 & X86_CR0_PE ) )  vcpu -> arch . mp_state = KVM_MP_STATE_RUNNABLE; vcpu_put ( vcpu ); 