aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/entry_32.S
diff options
context:
space:
mode:
authorDiana Craciun <diana.craciun@nxp.com>2018-07-28 09:06:38 +1000
committerMichael Ellerman <mpe@ellerman.id.au>2018-08-08 00:32:24 +1000
commitc28218d4abbf4f2035495334d8bfcba64bda4787 (patch)
tree3a07d01fe381d4d2a5221933aa47efe88a8b5b90 /arch/powerpc/kernel/entry_32.S
parentpowerpc/fsl: Add barrier_nospec implementation for NXP PowerPC Book3E (diff)
downloadlinux-dev-c28218d4abbf4f2035495334d8bfcba64bda4787.tar.xz
linux-dev-c28218d4abbf4f2035495334d8bfcba64bda4787.zip
powerpc/fsl: Sanitize the syscall table for NXP PowerPC 32 bit platforms
Used barrier_nospec to sanitize the syscall table. Signed-off-by: Diana Craciun <diana.craciun@nxp.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/kernel/entry_32.S')
-rw-r--r--arch/powerpc/kernel/entry_32.S10
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/entry_32.S b/arch/powerpc/kernel/entry_32.S
index 3bd097be90d9..e58c3f467db5 100644
--- a/arch/powerpc/kernel/entry_32.S
+++ b/arch/powerpc/kernel/entry_32.S
@@ -35,6 +35,7 @@
#include <asm/export.h>
#include <asm/asm-405.h>
#include <asm/feature-fixups.h>
+#include <asm/barrier.h>
/*
* MSR_KERNEL is > 0x10000 on 4xx/Book-E since it include MSR_CE.
@@ -360,6 +361,15 @@ syscall_dotrace_cont:
ori r10,r10,sys_call_table@l
slwi r0,r0,2
bge- 66f
+
+ barrier_nospec_asm
+ /*
+ * Prevent the load of the handler below (based on the user-passed
+ * system call number) being speculatively executed until the test
+ * against NR_syscalls and branch to .66f above has
+ * committed.
+ */
+
lwzx r10,r10,r0 /* Fetch system call handler [ptr] */
mtlr r10
addi r9,r1,STACK_FRAME_OVERHEAD