Skip to content

Commit c7aa00d

Browse files
wildea01Russell King
authored andcommitted
ARM: 7475/1: sys_trace: allow all syscall arguments to be updated via ptrace
Prior to syscall invocation, __sys_trace only reloads r0-r3 from the kernel stack, preventing the debugger from updating arguments 5-7 when signalled via ptrace. This patch updates the code to reload r0-r6, updating arguments 5 and 6 on the stack (argument 7 is only used by OABI indirect syscalls and can remain in a register). Reported-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
1 parent 6628521 commit c7aa00d

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎arch/arm/kernel/entry-common.S‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,8 @@ __sys_trace:
443443
mov scno, r0 @ syscall number (possibly new)
444444
add r1, sp, #S_R0 + S_OFF @ pointer to regs
445445
cmp scno, #NR_syscalls @ check upper syscall limit
446-
ldmccia r1, {r0 - r3} @ have to reload r0 - r3
446+
ldmccia r1, {r0 - r6} @ have to reload r0 - r6
447+
stmccia sp, {r4, r5} @ and update the stack args
447448
ldrcc pc, [tbl, scno, lsl #2] @ call sys_* routine
448449
b 2b
449450

0 commit comments

Comments
 (0)