diff options
author | Kees Cook <keescook@chromium.org> | 2012-11-15 16:12:17 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2012-11-19 09:14:18 -0500 |
commit | ad75b51459ae076a0d406391496f81b897bf6992 (patch) | |
tree | c34449b78cd833c2506237eb09d8cd291a2b63c3 /arch/arm/kernel/entry-common.S | |
parent | 9b790d71d58be65f9508ab60920eb978af828412 (diff) |
ARM: 7579/1: arch/allow a scno of -1 to not cause a SIGILL
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 <keescook@chromium.org>
Acked-by: Will Drewry <wad@chromium.org>
Reviewed-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/kernel/entry-common.S')
-rw-r--r-- | arch/arm/kernel/entry-common.S | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S index b621871dd277..ee81dbc6fa10 100644 --- a/arch/arm/kernel/entry-common.S +++ b/arch/arm/kernel/entry-common.S | |||
@@ -448,7 +448,10 @@ __sys_trace: | |||
448 | ldmccia r1, {r0 - r6} @ have to reload r0 - r6 | 448 | ldmccia r1, {r0 - r6} @ have to reload r0 - r6 |
449 | stmccia sp, {r4, r5} @ and update the stack args | 449 | stmccia sp, {r4, r5} @ and update the stack args |
450 | ldrcc pc, [tbl, scno, lsl #2] @ call sys_* routine | 450 | ldrcc pc, [tbl, scno, lsl #2] @ call sys_* routine |
451 | b 2b | 451 | cmp scno, #-1 @ skip the syscall? |
452 | bne 2b | ||
453 | add sp, sp, #S_OFF @ restore stack | ||
454 | b ret_slow_syscall | ||
452 | 455 | ||
453 | __sys_trace_return: | 456 | __sys_trace_return: |
454 | str r0, [sp, #S_R0 + S_OFF]! @ save returned r0 | 457 | str r0, [sp, #S_R0 + S_OFF]! @ save returned r0 |