Martin Schwidefsky wrote:Addendum:
So (!entryexit & regs->gprs < 0) translates to the debugger changed the
system call to something illegal on the first of the two ptrace calls. So
patch doesn't hurt for normal, non-ptraced operation but it might hurt
users of ptrace.
I don't think, it hurts. If a debugger willingly sets the syscall number
to -1, what would happen without the patch?
The kernel will set the result -ENOSYS into grps. So, even if trap
still indicates a syscall and a signal is pending, no syscall restarting
will be done.
With the patch, a debugger would observe changed behavior of the kernel
*only*, if it writes the syscall number to -1 on the first syscall
interception and then writes the result to ERESTARTXXXXX on the second,
while at the same time a signal is pending for the debugged process.
I assumed, that non of the current users of ptrace exactly does this.
If I'm wrong here, the patch *really* is bad.