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] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 23 Jan 2020 09:55:44 +0100
From:   Vitaly Kuznetsov <vkuznets@...hat.com>
To:     linmiaohe <linmiaohe@...wei.com>
Cc:     kvm@...r.kernel.org, linux-kernel@...r.kernel.org, x86@...nel.org,
        pbonzini@...hat.com, rkrcmar@...hat.com,
        sean.j.christopherson@...el.com, wanpengli@...cent.com,
        jmattson@...gle.com, joro@...tes.org, tglx@...utronix.de,
        mingo@...hat.com, bp@...en8.de, hpa@...or.com
Subject: Re: [PATCH] KVM: nVMX: set rflags to specify success in handle_invvpid() default case

linmiaohe <linmiaohe@...wei.com> writes:

> From: Miaohe Lin <linmiaohe@...wei.com>
>
> In handle_invvpid() default case, we just skip emulated instruction and
> forget to set rflags to specify success. This would result in indefinite
> rflags value and thus indeterminate return value for guest.
>
> Signed-off-by: Miaohe Lin <linmiaohe@...wei.com>
> ---
> 	Chinese New Year is coming. Happy Spring Festival! ^_^

Happy Spring Festival!

> ---
>  arch/x86/kvm/vmx/nested.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/x86/kvm/vmx/nested.c b/arch/x86/kvm/vmx/nested.c
> index 7608924ee8c1..985d3307ec56 100644
> --- a/arch/x86/kvm/vmx/nested.c
> +++ b/arch/x86/kvm/vmx/nested.c
> @@ -5165,7 +5165,7 @@ static int handle_invvpid(struct kvm_vcpu *vcpu)
>  		break;
>  	default:
>  		WARN_ON_ONCE(1);
> -		return kvm_skip_emulated_instruction(vcpu);
> +		break;
>  	}
>  
>  	return nested_vmx_succeed(vcpu);

Your patch seems to do the right thing, however, I started wondering if
WARN_ON_ONCE() is the right thing to do. SDM says that "If an
unsupported INVVPID type is specified, the instruction fails." and this
is similar to INVEPT and I decided to check what handle_invept()
does. Well, it does BUG_ON(). 

Are we doing the right thing in any of these cases?

-- 
Vitaly

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ