1 From foo@baz Mon 29 Apr 2019 11:38:37 AM CEST
2 From: Michael Ellerman <mpe@ellerman.id.au>
3 Date: Mon, 22 Apr 2019 00:20:14 +1000
4 Subject: powerpc/64: Use barrier_nospec in syscall entry
5 To: stable@vger.kernel.org, gregkh@linuxfoundation.org
6 Cc: linuxppc-dev@ozlabs.org, diana.craciun@nxp.com, msuchanek@suse.de, npiggin@gmail.com, christophe.leroy@c-s.fr
7 Message-ID: <20190421142037.21881-30-mpe@ellerman.id.au>
9 From: Michael Ellerman <mpe@ellerman.id.au>
11 commit 51973a815c6b46d7b23b68d6af371ad1c9d503ca upstream.
13 Our syscall entry is done in assembly so patch in an explicit
16 Based on a patch by Michal Suchanek.
18 Signed-off-by: Michal Suchanek <msuchanek@suse.de>
19 Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
20 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 arch/powerpc/kernel/entry_64.S | 10 ++++++++++
23 1 file changed, 10 insertions(+)
25 --- a/arch/powerpc/kernel/entry_64.S
26 +++ b/arch/powerpc/kernel/entry_64.S
28 #include <asm/hw_irq.h>
29 #include <asm/context_tracking.h>
31 +#include <asm/barrier.h>
32 #ifdef CONFIG_PPC_BOOK3S
33 #include <asm/exception-64s.h>
35 @@ -177,6 +178,15 @@ system_call: /* label this so stack tr
42 + * Prevent the load of the handler below (based on the user-passed
43 + * system call number) being speculatively executed until the test
44 + * against NR_syscalls and branch to .Lsyscall_enosys above has
48 ldx r12,r11,r0 /* Fetch system call handler [ptr] */
50 bctrl /* Call handler */