]> git.baikalelectronics.ru Git - kernel.git/commit
ptrace: ptrace_detach() can no longer race with SIGKILL
authorOleg Nesterov <oleg@redhat.com>
Thu, 16 Apr 2015 19:47:32 +0000 (12:47 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 17 Apr 2015 13:04:06 +0000 (09:04 -0400)
commit1f773b63588b71eb236e350a7aae1ec1d840c739
tree5cb701ad9bd68e19f6da29b29c086215b0292b67
parent211d818d2b30f7b70ec33911c6e1c69bae28a592
ptrace: ptrace_detach() can no longer race with SIGKILL

ptrace_detach() re-checks ->ptrace under tasklist lock and calls
release_task() if __ptrace_detach() returns true.  This was needed because
the __TASK_TRACED tracee could be killed/untraced, and it could even pass
exit_notify() before we take tasklist_lock.

But this is no longer possible after fd0f063fd964 "ptrace: ensure
arch_ptrace/ptrace_request can never race with SIGKILL".  We can turn
these checks into WARN_ON() and remove release_task().

While at it, document the setting of child->exit_code.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Cc: Pavel Labath <labath@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
kernel/ptrace.c