Commit 695ca07b authored by Richard Mortimer's avatar Richard Mortimer Committed by David S. Miller

[SPARC64]: Fix ptrace/strace

Don't clobber register %l0 while checking TI_SYS_NOERROR value in
syscall return path.  This bug was introduced by:

db7d9a4e

Problem narrowed down by Luis F. Ortiz and Richard Mortimer.

I tried using %l2 as suggested by Luis and that works for me.

Looking at the code I wonder if it makes sense to simplify the code
a little bit. The following works for me but I'm not sure how to
exercise the "NOERROR" codepath.
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 90bf8116
...@@ -1657,13 +1657,10 @@ ret_sys_call: ...@@ -1657,13 +1657,10 @@ ret_sys_call:
/* Check if force_successful_syscall_return() /* Check if force_successful_syscall_return()
* was invoked. * was invoked.
*/ */
ldub [%curptr + TI_SYS_NOERROR], %l0 ldub [%curptr + TI_SYS_NOERROR], %l2
brz,pt %l0, 1f brnz,a,pn %l2, 80f
nop
ba,pt %xcc, 80f
stb %g0, [%curptr + TI_SYS_NOERROR] stb %g0, [%curptr + TI_SYS_NOERROR]
1:
cmp %o0, -ERESTART_RESTARTBLOCK cmp %o0, -ERESTART_RESTARTBLOCK
bgeu,pn %xcc, 1f bgeu,pn %xcc, 1f
andcc %l0, (_TIF_SYSCALL_TRACE|_TIF_SECCOMP|_TIF_SYSCALL_AUDIT), %l6 andcc %l0, (_TIF_SYSCALL_TRACE|_TIF_SECCOMP|_TIF_SYSCALL_AUDIT), %l6
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment