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]
Message-ID: <b7ba969a-b050-d55c-4e94-0ce998a46cdf@redhat.com>
Date:   Mon, 11 Mar 2019 16:32:32 +0100
From:   Paolo Bonzini <pbonzini@...hat.com>
To:     Yang Weijiang <weijiang.yang@...el.com>
Cc:     Sean Christopherson <sean.j.christopherson@...el.com>,
        rkrcmar@...hat.com, jmattson@...gle.com,
        linux-kernel@...r.kernel.org, kvm@...r.kernel.org, mst@...hat.com,
        yu-cheng.yu@...el.com, Zhang Yi Z <yi.z.zhang@...ux.intel.com>
Subject: Re: [PATCH v3 7/8] KVM:X86: Add XSS bit 11 and 12 support for CET
 xsaves/xrstors.

On 10/03/19 14:35, Yang Weijiang wrote:
>>>> -		if (data != 0)
>>>> +		if (data & ~kvm_supported_xss())
>>>>  			return 1;
>>> You should instead check this against CPUID[0xD, 1].EDX:ECX.  If CET is
>>> disabled in CPUID, the guest should not be able to set it in MSR_IA32_CSS.
>>>
>>> Paolo
>> Thanks, OK, will change it.
> Hi, Paolo,
> How about change kvm_supported_xss() as below so that CPUID[0xd,1] check
> is implied in host_xss contents, vmx_supported_xss() now just returns host_xss
> in vmx.c. The purpose of this change is to make XSS data check
> common for other XSS based features.
> 
> +u64 kvm_supported_xss(void)
> +{
> +       return KVM_SUPPORTED_XSS & kvm_x86_ops->vmx_supported_xss();
> +}
> +
> 

This is correct; however, you should also check against the *guest*'s
CPUID[0xD, 1].EDX:ECX.

One possibility is to add a field kvm->guest_supported_xss and update it
in kvm_update_cpuid, then here you do

	if (data & ~kvm->guest_supported_xss)
		return 1;

Thanks,

Paolo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ