Skip to content

Commit 0ed9947

Browse files
author
Denys Vlasenko
committed
README-linux-ptrace: correct the description of suppressed signals
Signed-off-by: Denys Vlasenko <[email protected]>
1 parent bdec9cb commit 0ed9947

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

README-linux-ptrace

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ process (all its threads), even if some threads of the process are
5353
ptraced.
5454

5555
Tracer can kill a tracee with ptrace(PTRACE_KILL, pid, 0, 0). This
56-
opeartion is deprecated, use kill/tgkill(SIGKILL) instead.
56+
operation is deprecated, use kill/tgkill(SIGKILL) instead.
5757

5858
^^^ Oleg prefers to deprecate it instead of describing (and needing to
5959
support) PTRACE_KILL's quirks.
@@ -165,17 +165,13 @@ Note that sig value may be different from WSTOPSIG(status) value -
165165
tracer can cause a different signal to be injected.
166166

167167
Note that suppressed signal still causes syscalls to return
168-
prematurely. Restartable syscalls will be restarted (tracer will
169-
observe tracee to execute restart_syscall(2) syscall if tracer uses
170-
PTRACE_SYSCALL), non-restartable syscalls (for example, nanosleep) may
171-
return with -EINTR even though no observable signal is injected to the
172-
tracee.
173-
174-
Note that restarting ptrace commands issued in ptrace-stops other than
175-
signal-delivery-stop are not guaranteed to inject a signal, even if sig
176-
is nonzero. No error is reported, nonzero sig may simply be ignored.
177-
Ptrace users should not try to "create new signal" this way: use
178-
tgkill(2) instead.
168+
prematurely. Kernel should always restart the syscall in this case:
169+
tracer would observe a new syscall-enter-stop for the same syscall,
170+
or, in case of syscalls returning ERESTART_RESTARTBLOCK,
171+
tracer would observe a syscall-enter-stop for restart_syscall(2)
172+
syscall. There may still be bugs in this area which cause some syscalls
173+
to instead return with -EINTR even though no observable signal
174+
was injected to the tracee.
179175

180176
This is a cause of confusion among ptrace users. One typical scenario
181177
is that tracer observes group-stop, mistakes it for

0 commit comments

Comments
 (0)