]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
x86/asm: Don't use the confusing '.ifeq' directive
authorJosh Poimboeuf <jpoimboe@redhat.com>
Fri, 20 Oct 2017 16:21:35 +0000 (11:21 -0500)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Sat, 6 Jan 2018 12:22:43 +0000 (13:22 +0100)
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 <jpoimboe@redhat.com>
Cc: Andrei Vagin <avagin@virtuozzo.com>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/757da028e802c7e98d23fbab8d234b1063e161cf.1508516398.git.jpoimboe@redhat.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
(cherry picked from commit 82c62fa0c49aa305104013cee4468772799bb391)
Signed-off-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
arch/x86/entry/entry_64.S
arch/x86/kernel/head_32.S
arch/x86/kernel/head_64.S

index 2e4fc6425f47b4069c5e5d041541c6ed98ff29c3..34adfe0221d29d394a6bf019eaa354f8399059df 100644 (file)
@@ -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
 
index 1f85ee8f9439fff69f6bc7a38523b38f88311cb0..337a65377baffd20050180d2f4c42a239c2e4909 100644 (file)
@@ -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
index 12daaa0b187fe9bdc9cf433b81f46e2820198316..a2d8541b1da472a49c7b11ae2992c1cea8e050e6 100644 (file)
@@ -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