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: <530B2949.4030000@redhat.com>
Date:	Mon, 24 Feb 2014 12:13:13 +0100
From:	Paolo Bonzini <pbonzini@...hat.com>
To:	"Liu, Jinsong" <jinsong.liu@...el.com>,
	"'kvm@...r.kernel.org'" <kvm@...r.kernel.org>,
	"'linux-kernel@...r.kernel.org'" <linux-kernel@...r.kernel.org>,
	"'qemu-devel@...gnu.org'" <qemu-devel@...gnu.org>
CC:	"'gleb@...hat.com'" <gleb@...hat.com>,
	"'hpa@...or.com'" <hpa@...or.com>
Subject: Re: [PATCH v5 3/3] KVM: x86: Enable Intel MPX for guest

Il 24/02/2014 11:58, Liu, Jinsong ha scritto:
> @@ -599,6 +599,9 @@ int __kvm_set_xcr(struct kvm_vcpu *vcpu, u32 index, u64 xcr)
>  	u64 old_xcr0 = vcpu->arch.xcr0;
>  	u64 valid_bits;
>
> +	if (!kvm_x86_ops->mpx_supported || !kvm_x86_ops->mpx_supported())
> +		xcr0 &= ~(XSTATE_BNDREGS | XSTATE_BNDCSR);
> +
>  	/* Only support XCR_XFEATURE_ENABLED_MASK(xcr0) now  */
>  	if (index != XCR_XFEATURE_ENABLED_MASK)
>  		return 1;

This hunk is incorrect, and I can simply drop it when applying.  If MPX 
is not supported, it should not be in the 0Dh CPUID leaf and thus in 
vcpu->arch.guest_supported_xcr0.

This however relies on userspace passing a "sensible" value of CPUID. 
I'll send a patch to strengthen the computation of guest_supported_xcr0.

Thanks!

Paolo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ