lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <a2900ee5-61cf-a35b-7ae5-b326052e0a6d@redhat.com>
Date:   Sat, 3 Aug 2019 08:36:25 +0200
From:   Paolo Bonzini <pbonzini@...hat.com>
To:     Wanpeng Li <kernellwp@...il.com>, linux-kernel@...r.kernel.org,
        kvm@...r.kernel.org
Cc:     Radim Krčmář <rkrcmar@...hat.com>,
        Christian Borntraeger <borntraeger@...ibm.com>,
        Marc Zyngier <Marc.Zyngier@....com>, stable@...r.kernel.org
Subject: Re: [PATCH v3 1/3] KVM: Fix leak vCPU's VMCS value into other pCPU

On 01/08/19 05:30, Wanpeng Li wrote:
> +bool kvm_arch_dy_runnable(struct kvm_vcpu *vcpu)
> +{
> +	if (READ_ONCE(vcpu->arch.pv.pv_unhalted))
> +		return true;
> +
> +	if (kvm_test_request(KVM_REQ_NMI, vcpu) ||
> +	    (READ_ONCE(vcpu->arch.nmi_pending) &&
> +	     kvm_x86_ops->nmi_allowed(vcpu)))

You cannot check kvm_x86_ops->nmi_allowed(vcpu), so just use
kvm_test_request.

> +		return true;
> +
> +	if (kvm_test_request(KVM_REQ_SMI, vcpu) ||
> +	    (READ_ONCE(vcpu->arch.smi_pending) && !is_smm(vcpu)))
> +		return true;

Same here, if only for simplicity.

> +	if (kvm_test_request(KVM_REQ_EVENT, vcpu))
> +		return true;
> +
> +	if (vcpu->arch.apicv_active && kvm_x86_ops->apicv_test_pi_on(vcpu))
> +		return true;

Let's call it apicv_has_pending_interrupt instead.

Also, please add a comment in kvm_main.c saying that
kvm_arch_dy_runnable is called outside vcpu_load/vcpu_put.

Paolo

> +
> +	return false;
> +}

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ