Skip to content

(Was: ptrace: clean transitions between TASK_STOPPED and TRACED)

Oleg Nesterov lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest1 patch 104 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/1ptrace: make sure do_wait() won't hang after PTRACE_ATTACHkernel/ptrace.c+14 -1105 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/1] (Was: ptrace: clean transitions between TASK_STOPPED and TRACED)
Quoted 3 lines · Tejun Heo

Currently, if the task is STOPPED on ptrace attach, it's left alone and the state is silently changed to TRACED on the next ptrace call.

In particular, this means that it is very hard to attach correctly. Any ptrace request needs STOPPED/TRACED tracee, but apart from wait() there is no simple way to verify this and many applications (imho rightly) assume that wait() after PTRACE_ATTACH should work.

While this patch should fix this old known problem, it needs more discussion.

Tejun, Roland, perhaps it makes sense to fix this partcular problem first? Personally I do not know, but as Jan reports this is really annoying for gdb at least.

Oleg.