Skip to contentSkip to conversation

x86: fux duplicated X86_BUG(9) macro

PATCH In review Dave Hansen 3 participants 3 messages Jun 18, 2016 – Jul 9, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86: fux duplicated X86_BUG(9) macro

Now sending with actual stable@ address...

--

From: Dave Hansen <[email protected]>

cpufeatures.h currently defines X86_BUG(9) twice on 32-bit:

	#define X86_BUG_NULL_SEG        X86_BUG(9) /* Nulling a selector preserves the base */
	...
	#ifdef CONFIG_X86_32
	#define X86_BUG_ESPFIX          X86_BUG(9) /* "" IRET to 16-bit SS corrupts ESP/RSP high bits */
	#endif

I think what happened was that this added the X86_BUG_ESPFIX, but in an #ifdef below most of the bugs:

[58a5aac5] x86/entry/32: Introduce and use X86_BUG_ESPFIX instead of paravirt_enabled

Then this came along and added X86_BUG_NULL_SEG, but collided with the earlier one that did the bug below the main block defining all the X86_BUG()s.

[7a5d6704] x86/cpu: Probe the behavior of nulling out a segment at boot time

---

 b/arch/x86/include/asm/cpufeatures.h |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
arch/x86/include/asm/cpufeatures.h renamed from arch/x86/include/asm/cpufeatures.h~fix-x86-bugs-macros +2 -4
diff -puN arch/x86/include/asm/cpufeatures.h~fix-x86-bugs-macros arch/x86/include/asm/cpufeatures.h
@@ -301,10 +301,6 @@
 #define X86_BUG_FXSAVE_LEAK	X86_BUG(6) /* FXSAVE leaks FOP/FIP/FOP */
 #define X86_BUG_CLFLUSH_MONITOR	X86_BUG(7) /* AAI65, CLFLUSH required before MONITOR */
 #define X86_BUG_SYSRET_SS_ATTRS	X86_BUG(8) /* SYSRET doesn't fix up SS attrs */
-#define X86_BUG_NULL_SEG	X86_BUG(9) /* Nulling a selector preserves the base */
-#define X86_BUG_SWAPGS_FENCE	X86_BUG(10) /* SWAPGS without input dep on GS */
-
-
 #ifdef CONFIG_X86_32
 /*
  * 64-bit kernels don't use X86_BUG_ESPFIX.  Make the define conditional
@@ -312,5 +308,7 @@
  */
 #define X86_BUG_ESPFIX		X86_BUG(9) /* "" IRET to 16-bit SS corrupts ESP/RSP high bits */
 #endif
+#define X86_BUG_NULL_SEG	X86_BUG(10) /* Nulling a selector preserves the base */
+#define X86_BUG_SWAPGS_FENCE	X86_BUG(11) /* SWAPGS without input dep on GS */
 
 #endif /* _ASM_X86_CPUFEATURES_H */

_

Acked-by on v1 1/1
#1 lore raw
Quoted 8 lines · Dave Hansen

Now sending with actual stable@ address...

--

From: Dave Hansen <[email protected]>

cpufeatures.h currently defines X86_BUG(9) twice on 32-bit:

That being said, you or Ingo should consider fixing the typo in $SUBJECT.

Quoted 49 lines
        #define X86_BUG_NULL_SEG        X86_BUG(9) /* Nulling a selector preserves the base */
        ...
        #ifdef CONFIG_X86_32
        #define X86_BUG_ESPFIX          X86_BUG(9) /* "" IRET to 16-bit SS corrupts ESP/RSP high bits */
        #endif

I think what happened was that this added the X86_BUG_ESPFIX, but in an #ifdef below most of the bugs:

[58a5aac5] x86/entry/32: Introduce and use X86_BUG_ESPFIX instead of paravirt_enabled

Then this came along and added X86_BUG_NULL_SEG, but collided with the earlier one that did the bug below the main block defining all the X86_BUG()s.

[7a5d6704] x86/cpu: Probe the behavior of nulling out a segment at boot time

---

 b/arch/x86/include/asm/cpufeatures.h |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff -puN arch/x86/include/asm/cpufeatures.h~fix-x86-bugs-macros arch/x86/include/asm/cpufeatures.h

arch/x86/include/asm/cpufeatures.h 2016-06-17 17:10:30.982602989 -0700 renamed from arch/x86/include/asm/cpufeatures.h~fix-x86-bugs-macros 2016-06-17 17:10:30.978602807 -0700 +2 -4
@@ -301,10 +301,6 @@
 #define X86_BUG_FXSAVE_LEAK    X86_BUG(6) /* FXSAVE leaks FOP/FIP/FOP */
 #define X86_BUG_CLFLUSH_MONITOR        X86_BUG(7) /* AAI65, CLFLUSH required before MONITOR */
 #define X86_BUG_SYSRET_SS_ATTRS        X86_BUG(8) /* SYSRET doesn't fix up SS attrs */
-#define X86_BUG_NULL_SEG       X86_BUG(9) /* Nulling a selector preserves the base */
-#define X86_BUG_SWAPGS_FENCE   X86_BUG(10) /* SWAPGS without input dep on GS */
-
-
 #ifdef CONFIG_X86_32
 /*
  * 64-bit kernels don't use X86_BUG_ESPFIX.  Make the define conditional
@@ -312,5 +308,7 @@
  */
 #define X86_BUG_ESPFIX         X86_BUG(9) /* "" IRET to 16-bit SS corrupts ESP/RSP high bits */
 #endif
+#define X86_BUG_NULL_SEG       X86_BUG(10) /* Nulling a selector preserves the base */
+#define X86_BUG_SWAPGS_FENCE   X86_BUG(11) /* SWAPGS without input dep on GS */
 
 #endif /* _ASM_X86_CPUFEATURES_H */

_

Signature · 2 lines
Andy Lutomirski
AMA Capital Management, LLC
#2 lore raw

[tip:x86/urgent] x86/cpu: Fix duplicated X86_BUG(9) macro

In reply to Dave Hansen
x86/cpu: Fix duplicated X86_BUG(9) macro
Commit-ID:  8709ed4d4b0eab04561c1ec9e6ea50fd1e3897ff
Gitweb:     http://git.kernel.org/tip/8709ed4d4b0eab04561c1ec9e6ea50fd1e3897ff
Author:     Dave Hansen <[email protected]>
AuthorDate: Fri, 17 Jun 2016 17:15:03 -0700
Committer:  Ingo Molnar <[email protected]>
CommitDate: Sat, 9 Jul 2016 14:06:06 +0200

x86/cpu: Fix duplicated X86_BUG(9) macro

cpufeatures.h currently defines X86_BUG(9) twice on 32-bit:

	#define X86_BUG_NULL_SEG        X86_BUG(9) /* Nulling a selector preserves the base */
	...
	#ifdef CONFIG_X86_32
	#define X86_BUG_ESPFIX          X86_BUG(9) /* "" IRET to 16-bit SS corrupts ESP/RSP high bits */
	#endif

I think what happened was that this added the X86_BUG_ESPFIX, but in an #ifdef below most of the bugs:

58a5aac53313 x86/entry/32: Introduce and use X86_BUG_ESPFIX instead of paravirt_enabled

Then this came along and added X86_BUG_NULL_SEG, but collided with the earlier one that did the bug below the main block defining all the X86_BUG()s.

7a5d67048745 x86/cpu: Probe the behavior of nulling out a segment at boot time

Cc Andy Lutomirski <[email protected]>
Cc Borislav Petkov <[email protected]>
Cc Brian Gerst <[email protected]>
Cc Dave Hansen <[email protected]>
Cc Denys Vlasenko <[email protected]>
Cc H. Peter Anvin <[email protected]>
Cc Josh Poimboeuf <[email protected]>
Cc Linus Torvalds <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Thomas Gleixner <[email protected]>
---
 arch/x86/include/asm/cpufeatures.h | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
arch/x86/include/asm/cpufeatures.h +2 -4
index 4a41348..c64b1e9 100644
@@ -301,10 +301,6 @@
 #define X86_BUG_FXSAVE_LEAK	X86_BUG(6) /* FXSAVE leaks FOP/FIP/FOP */
 #define X86_BUG_CLFLUSH_MONITOR	X86_BUG(7) /* AAI65, CLFLUSH required before MONITOR */
 #define X86_BUG_SYSRET_SS_ATTRS	X86_BUG(8) /* SYSRET doesn't fix up SS attrs */
-#define X86_BUG_NULL_SEG	X86_BUG(9) /* Nulling a selector preserves the base */
-#define X86_BUG_SWAPGS_FENCE	X86_BUG(10) /* SWAPGS without input dep on GS */
-
-
 #ifdef CONFIG_X86_32
 /*
  * 64-bit kernels don't use X86_BUG_ESPFIX.  Make the define conditional
@@ -312,5 +308,7 @@
  */
 #define X86_BUG_ESPFIX		X86_BUG(9) /* "" IRET to 16-bit SS corrupts ESP/RSP high bits */
 #endif
+#define X86_BUG_NULL_SEG	X86_BUG(10) /* Nulling a selector preserves the base */
+#define X86_BUG_SWAPGS_FENCE	X86_BUG(11) /* SWAPGS without input dep on GS */
 
 #endif /* _ASM_X86_CPUFEATURES_H */