x86/speculation, objtool: Annotate indirect calls/jumps for objtool on 32-bit kernels

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Mon Mar 19 02:59:08 PDT 2018


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=a14bff131108faf50cc0cf864589fd71ee216c96
Commit:     a14bff131108faf50cc0cf864589fd71ee216c96
Parent:     b5069782453459f6ec1fdeb495d9901a4545fcb5
Author:     Andy Whitcroft <apw at canonical.com>
AuthorDate: Wed Mar 14 11:24:27 2018 +0000
Committer:  Ingo Molnar <mingo at kernel.org>
CommitDate: Wed Mar 14 13:24:31 2018 +0100

    x86/speculation, objtool: Annotate indirect calls/jumps for objtool on 32-bit kernels
    
    In the following commit:
    
      9e0e3c5130e9 ("x86/speculation, objtool: Annotate indirect calls/jumps for objtool")
    
    ... we added annotations for CALL_NOSPEC/JMP_NOSPEC on 64-bit x86 kernels,
    but we did not annotate the 32-bit path.
    
    Annotate it similarly.
    
    Signed-off-by: Andy Whitcroft <apw at canonical.com>
    Acked-by: Peter Zijlstra (Intel) <peterz at infradead.org>
    Cc: Andy Lutomirski <luto at kernel.org>
    Cc: Arjan van de Ven <arjan at linux.intel.com>
    Cc: Borislav Petkov <bp at alien8.de>
    Cc: Dan Williams <dan.j.williams at intel.com>
    Cc: Dave Hansen <dave.hansen at linux.intel.com>
    Cc: David Woodhouse <dwmw2 at infradead.org>
    Cc: David Woodhouse <dwmw at amazon.co.uk>
    Cc: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
    Cc: Josh Poimboeuf <jpoimboe at redhat.com>
    Cc: Linus Torvalds <torvalds at linux-foundation.org>
    Cc: Peter Zijlstra <peterz at infradead.org>
    Cc: Thomas Gleixner <tglx at linutronix.de>
    Link: http://lkml.kernel.org/r/20180314112427.22351-1-apw@canonical.com
    Signed-off-by: Ingo Molnar <mingo at kernel.org>
---
 arch/x86/include/asm/nospec-branch.h | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/arch/x86/include/asm/nospec-branch.h b/arch/x86/include/asm/nospec-branch.h
index b7063cfa19f9..b3996d60f981 100644
--- a/arch/x86/include/asm/nospec-branch.h
+++ b/arch/x86/include/asm/nospec-branch.h
@@ -183,7 +183,10 @@
  * otherwise we'll run out of registers. We don't care about CET
  * here, anyway.
  */
-# define CALL_NOSPEC ALTERNATIVE("call *%[thunk_target]\n",	\
+# define CALL_NOSPEC						\
+	ALTERNATIVE(						\
+	ANNOTATE_RETPOLINE_SAFE					\
+	"call *%[thunk_target]\n",				\
 	"       jmp    904f;\n"					\
 	"       .align 16\n"					\
 	"901:	call   903f;\n"					\



More information about the linux-mtd-cvs mailing list