Skip to content

Commit 695ca07

Browse files
oldelvetdavem330
authored andcommitted
[SPARC64]: Fix ptrace/strace
Don't clobber register %l0 while checking TI_SYS_NOERROR value in syscall return path. This bug was introduced by: db7d9a4 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: David S. Miller <[email protected]>
1 parent 90bf811 commit 695ca07

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

arch/sparc64/kernel/entry.S

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1657,13 +1657,10 @@ ret_sys_call:
16571657
/* Check if force_successful_syscall_return()
16581658
* was invoked.
16591659
*/
1660-
ldub [%curptr + TI_SYS_NOERROR], %l0
1661-
brz,pt %l0, 1f
1662-
nop
1663-
ba,pt %xcc, 80f
1660+
ldub [%curptr + TI_SYS_NOERROR], %l2
1661+
brnz,a,pn %l2, 80f
16641662
stb %g0, [%curptr + TI_SYS_NOERROR]
16651663

1666-
1:
16671664
cmp %o0, -ERESTART_RESTARTBLOCK
16681665
bgeu,pn %xcc, 1f
16691666
andcc %l0, (_TIF_SYSCALL_TRACE|_TIF_SECCOMP|_TIF_SYSCALL_AUDIT), %l6

0 commit comments

Comments
 (0)