]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob
5449e5421ab357b78e4f19646d5d1cc9de679119
[thirdparty/kernel/stable-queue.git] /
1 From a14bff131108faf50cc0cf864589fd71ee216c96 Mon Sep 17 00:00:00 2001
2 From: Andy Whitcroft <apw@canonical.com>
3 Date: Wed, 14 Mar 2018 11:24:27 +0000
4 Subject: x86/speculation, objtool: Annotate indirect calls/jumps for objtool on 32-bit kernels
5
6 From: Andy Whitcroft <apw@canonical.com>
7
8 commit a14bff131108faf50cc0cf864589fd71ee216c96 upstream.
9
10 In the following commit:
11
12 9e0e3c5130e9 ("x86/speculation, objtool: Annotate indirect calls/jumps for objtool")
13
14 ... we added annotations for CALL_NOSPEC/JMP_NOSPEC on 64-bit x86 kernels,
15 but we did not annotate the 32-bit path.
16
17 Annotate it similarly.
18
19 Signed-off-by: Andy Whitcroft <apw@canonical.com>
20 Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
21 Cc: Andy Lutomirski <luto@kernel.org>
22 Cc: Arjan van de Ven <arjan@linux.intel.com>
23 Cc: Borislav Petkov <bp@alien8.de>
24 Cc: Dan Williams <dan.j.williams@intel.com>
25 Cc: Dave Hansen <dave.hansen@linux.intel.com>
26 Cc: David Woodhouse <dwmw2@infradead.org>
27 Cc: David Woodhouse <dwmw@amazon.co.uk>
28 Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
29 Cc: Josh Poimboeuf <jpoimboe@redhat.com>
30 Cc: Linus Torvalds <torvalds@linux-foundation.org>
31 Cc: Peter Zijlstra <peterz@infradead.org>
32 Cc: Thomas Gleixner <tglx@linutronix.de>
33 Link: http://lkml.kernel.org/r/20180314112427.22351-1-apw@canonical.com
34 Signed-off-by: Ingo Molnar <mingo@kernel.org>
35 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
36
37 ---
38 arch/x86/include/asm/nospec-branch.h | 5 ++++-
39 1 file changed, 4 insertions(+), 1 deletion(-)
40
41 --- a/arch/x86/include/asm/nospec-branch.h
42 +++ b/arch/x86/include/asm/nospec-branch.h
43 @@ -183,7 +183,10 @@
44 * otherwise we'll run out of registers. We don't care about CET
45 * here, anyway.
46 */
47 -# define CALL_NOSPEC ALTERNATIVE("call *%[thunk_target]\n", \
48 +# define CALL_NOSPEC \
49 + ALTERNATIVE( \
50 + ANNOTATE_RETPOLINE_SAFE \
51 + "call *%[thunk_target]\n", \
52 " jmp 904f;\n" \
53 " .align 16\n" \
54 "901: call 903f;\n" \