using ptrace to cancel a syscall on sparc

Dmitry V. Levin ldv at
Sun Dec 20 23:31:44 UTC 2015

On Sun, Dec 20, 2015 at 12:47:54AM -0500, Mike Frysinger wrote:
> i've been playing with ptrace on sparc and trying to use it to watch and
> cancel specific syscalls.  i have this working for other arches already.
> i'm having trouble with canceling of the syscall itself.  seems like
> no matter what i stuff into o0, the kernel executes the unlink.  i've
> tried tracing arch/sparc/kernel/syscalls.S and kernel/head_64.S, the
> the entry is linux_sparc_syscall32 which calls linux_syscall_trace32,
> but it seems like the o0 stuff doesn't seem to work for me.  my sparc
> asm foo isn't strong enough to figure out what's going wrong :/.

Yes, sparc is odd in this respect: whatever you write to u_regs[] on
entering syscall, it doesn't affect syscall number or syscall arguments.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <>

More information about the Strace-devel mailing list