2011-04-28 18:01:23

by Robert Święcki

[permalink] [raw]
Subject: (ptrace) regs->orig_ax == -1 upon (rt_)sigreturn syscall exit

Hi, while ptrace()'ing a process which performs (rt_)sigreturn the
regs->orig_ax field upon syscall exit is set to -1 in
restore_sigcontext() (both in 32 and 64bit modes) with the following
comment:

regs->orig_ax = -1; /* disable syscall checks */

As far as I understand this field (regs->orig_ax) should be a copy of
regs->ax from before syscall enter, and basically should display a
syscall number (even upon syscall exit). Therefore I was wondering if
the current behavior isn't too hackish and in order to achieve some
goals it is breaking the intended behavior. I guess I could prepare a
patch which "fixes" this unless there are any strong reasons to leave
it as is.

--
Robert Święcki