| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- From 05096d194a52721b3f4add5f854fc62296b82e72 Mon Sep 17 00:00:00 2001
- From: Josh Poimboeuf <[email protected]>
- Date: Fri, 20 Oct 2017 11:21:35 -0500
- Subject: [PATCH 079/231] x86/asm: Don't use the confusing '.ifeq' directive
- MIME-Version: 1.0
- Content-Type: text/plain; charset=UTF-8
- Content-Transfer-Encoding: 8bit
- CVE-2017-5754
- I find the '.ifeq <expression>' directive to be confusing. Reading it
- quickly seems to suggest its opposite meaning, or that it's missing an
- argument.
- Improve readability by replacing all of its x86 uses with
- '.if <expression> == 0'.
- Signed-off-by: Josh Poimboeuf <[email protected]>
- Cc: Andrei Vagin <[email protected]>
- Cc: Andy Lutomirski <[email protected]>
- Cc: Linus Torvalds <[email protected]>
- Cc: Peter Zijlstra <[email protected]>
- Cc: Thomas Gleixner <[email protected]>
- Link: http://lkml.kernel.org/r/757da028e802c7e98d23fbab8d234b1063e161cf.1508516398.git.jpoimboe@redhat.com
- Signed-off-by: Ingo Molnar <[email protected]>
- (cherry picked from commit 82c62fa0c49aa305104013cee4468772799bb391)
- Signed-off-by: Andy Whitcroft <[email protected]>
- Signed-off-by: Kleber Sacilotto de Souza <[email protected]>
- (cherry picked from commit 981dedac1061fb47d0b04e07f6752be195d7e41a)
- Signed-off-by: Fabian Grünbichler <[email protected]>
- ---
- arch/x86/entry/entry_64.S | 2 +-
- arch/x86/kernel/head_32.S | 2 +-
- arch/x86/kernel/head_64.S | 2 +-
- 3 files changed, 3 insertions(+), 3 deletions(-)
- diff --git a/arch/x86/entry/entry_64.S b/arch/x86/entry/entry_64.S
- index 2e4fc6425f47..34adfe0221d2 100644
- --- a/arch/x86/entry/entry_64.S
- +++ b/arch/x86/entry/entry_64.S
- @@ -830,7 +830,7 @@ ENTRY(\sym)
-
- ASM_CLAC
-
- - .ifeq \has_error_code
- + .if \has_error_code == 0
- pushq $-1 /* ORIG_RAX: no syscall to restart */
- .endif
-
- diff --git a/arch/x86/kernel/head_32.S b/arch/x86/kernel/head_32.S
- index 1f85ee8f9439..337a65377baf 100644
- --- a/arch/x86/kernel/head_32.S
- +++ b/arch/x86/kernel/head_32.S
- @@ -435,7 +435,7 @@ ENTRY(early_idt_handler_array)
- # 24(%rsp) error code
- i = 0
- .rept NUM_EXCEPTION_VECTORS
- - .ifeq (EXCEPTION_ERRCODE_MASK >> i) & 1
- + .if ((EXCEPTION_ERRCODE_MASK >> i) & 1) == 0
- pushl $0 # Dummy error code, to make stack frame uniform
- .endif
- pushl $i # 20(%esp) Vector number
- diff --git a/arch/x86/kernel/head_64.S b/arch/x86/kernel/head_64.S
- index 12daaa0b187f..a2d8541b1da4 100644
- --- a/arch/x86/kernel/head_64.S
- +++ b/arch/x86/kernel/head_64.S
- @@ -258,7 +258,7 @@ ENDPROC(start_cpu0)
- ENTRY(early_idt_handler_array)
- i = 0
- .rept NUM_EXCEPTION_VECTORS
- - .ifeq (EXCEPTION_ERRCODE_MASK >> i) & 1
- + .if ((EXCEPTION_ERRCODE_MASK >> i) & 1) == 0
- UNWIND_HINT_IRET_REGS
- pushq $0 # Dummy error code, to make stack frame uniform
- .else
- --
- 2.14.2
|