Skip to content

Commit

Permalink
powerpc/fsl: Sanitize the syscall table for NXP PowerPC 32 bit platforms
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Diana Craciun authored and Michael Ellerman committed Aug 7, 2018
1 parent ebcd1bf commit c28218d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions arch/powerpc/kernel/entry_32.S
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit c28218d

Please sign in to comment.