Skip to content

Commit

Permalink
xtensa: use actual syscall number in do_syscall_trace_leave
Browse files Browse the repository at this point in the history
Syscall may alter pt_regs structure passed to it, resulting in a
mismatch between syscall entry end syscall exit entries in the ftrace.
Temporary restore syscall field of the pt_regs for the duration of
do_syscall_trace_leave.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
  • Loading branch information
jcmvbkbc committed Apr 4, 2019
1 parent 79a3aaa commit 2201f31
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions arch/xtensa/kernel/entry.S
Original file line number Diff line number Diff line change
Expand Up @@ -1860,6 +1860,8 @@ ENTRY(system_call)
l32i a7, a2, PT_SYSCALL

1:
s32i a7, a1, 4

/* syscall = sys_call_table[syscall_nr] */

movi a4, sys_call_table
Expand Down Expand Up @@ -1893,8 +1895,12 @@ ENTRY(system_call)
retw

1:
l32i a4, a1, 4
l32i a3, a2, PT_SYSCALL
s32i a4, a2, PT_SYSCALL
mov a6, a2
call4 do_syscall_trace_leave
s32i a3, a2, PT_SYSCALL
retw

ENDPROC(system_call)
Expand Down

0 comments on commit 2201f31

Please sign in to comment.