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, 5 May 2016 10:24:23 +0200
From:	Borislav Petkov <bp@...e.de>
To:	Brooks Moses <bmoses@...gle.com>
Cc:	linux-kernel@...r.kernel.org, Ian Kasprzak <iankaz@...gle.com>,
	Paolo Bonzini <pbonzini@...hat.com>
Subject: Re: Is BIT() in arch/x86/include/uapi/asm/kvm.h defined? Where?

On Wed, May 04, 2016 at 05:49:27PM -0700, Brooks Moses wrote:
> When I run "make ARCH=x86 headers_install", and then write a simple C
> file that #includes "asm/kvm.h" from the resulting tree, I get a
> compiler error: the BIT() macro used on line 219 of that file is
> undefined:

The below patch should help...

@Paulo: btw, any chance we can fix that "signifcant" typo :-) in
KVM_CPUID_FLAG_SIGNIFCANT_INDEX or is it user-visible and cast in
stone?

---
From: Borislav Petkov <bp@...e.de>
Date: Thu, 5 May 2016 10:18:23 +0200
Subject: [PATCH] x86/kvm: Do not use BIT() in user-exported header

Apparently, we're not exporting BIT() to userspace.

Reported-by: Brooks Moses <bmoses@...gle.com>
Signed-off-by: Borislav Petkov <bp@...e.de>
Cc: Paolo Bonzini <pbonzini@...hat.com>
---
 arch/x86/include/uapi/asm/kvm.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/x86/include/uapi/asm/kvm.h b/arch/x86/include/uapi/asm/kvm.h
index cd54147cb365..739c0c594022 100644
--- a/arch/x86/include/uapi/asm/kvm.h
+++ b/arch/x86/include/uapi/asm/kvm.h
@@ -216,9 +216,9 @@ struct kvm_cpuid_entry2 {
 	__u32 padding[3];
 };
 
-#define KVM_CPUID_FLAG_SIGNIFCANT_INDEX		BIT(0)
-#define KVM_CPUID_FLAG_STATEFUL_FUNC		BIT(1)
-#define KVM_CPUID_FLAG_STATE_READ_NEXT		BIT(2)
+#define KVM_CPUID_FLAG_SIGNIFCANT_INDEX		(1 << 0)
+#define KVM_CPUID_FLAG_STATEFUL_FUNC		(1 << 1)
+#define KVM_CPUID_FLAG_STATE_READ_NEXT		(1 << 2)
 
 /* for KVM_SET_CPUID2 */
 struct kvm_cpuid2 {
-- 
2.7.3

SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)
-- 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ