Skip to content

Commit

Permalink
ARM: 7579/1: arch/allow a scno of -1 to not cause a SIGILL
Browse files Browse the repository at this point in the history
On tracehook-friendly platforms, a system call number of -1 falls
through without running much code or taking much action.

ARM is different. This adds a short-circuit check in the trace path to
avoid any additional work, as suggested by Russell King, to make sure
that ARM behaves the same way as other platforms.

Signed-off-by: Kees Cook <[email protected]>
Acked-by: Will Drewry <[email protected]>
Reviewed-by: Will Deacon <[email protected]>
Signed-off-by: Russell King <[email protected]>
  • Loading branch information
kees authored and Russell King committed Nov 19, 2012
1 parent 9b790d7 commit ad75b51
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion arch/arm/kernel/entry-common.S
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,10 @@ __sys_trace:
ldmccia r1, {r0 - r6} @ have to reload r0 - r6
stmccia sp, {r4, r5} @ and update the stack args
ldrcc pc, [tbl, scno, lsl #2] @ call sys_* routine
b 2b
cmp scno, #-1 @ skip the syscall?
bne 2b
add sp, sp, #S_OFF @ restore stack
b ret_slow_syscall

__sys_trace_return:
str r0, [sp, #S_R0 + S_OFF]! @ save returned r0
Expand Down

0 comments on commit ad75b51

Please sign in to comment.