Commit c28218d4 authored by Diana Craciun's avatar Diana Craciun Committed by Michael Ellerman

powerpc/fsl: Sanitize the syscall table for NXP PowerPC 32 bit platforms

Used barrier_nospec to sanitize the syscall table.
Signed-off-by: default avatarDiana Craciun <diana.craciun@nxp.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent ebcd1bfc
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
#include <asm/export.h> #include <asm/export.h>
#include <asm/asm-405.h> #include <asm/asm-405.h>
#include <asm/feature-fixups.h> #include <asm/feature-fixups.h>
#include <asm/barrier.h>
/* /*
* MSR_KERNEL is > 0x10000 on 4xx/Book-E since it include MSR_CE. * MSR_KERNEL is > 0x10000 on 4xx/Book-E since it include MSR_CE.
...@@ -360,6 +361,15 @@ syscall_dotrace_cont: ...@@ -360,6 +361,15 @@ syscall_dotrace_cont:
ori r10,r10,sys_call_table@l ori r10,r10,sys_call_table@l
slwi r0,r0,2 slwi r0,r0,2
bge- 66f 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] */ lwzx r10,r10,r0 /* Fetch system call handler [ptr] */
mtlr r10 mtlr r10
addi r9,r1,STACK_FRAME_OVERHEAD addi r9,r1,STACK_FRAME_OVERHEAD
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment