mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-22 22:51:37 +00:00
kill PT_ATTACHED
Since the patch
"Fix ptrace_attach()/ptrace_traceme()/de_thread() race"
commit f5b40e363a
we set PT_ATTACHED and change child->parent "atomically" wrt task_list lock.
This means we can remove the checks like "PT_ATTACHED && ->parent != ptracer"
which were needed to catch the "ptrace attach is in progress" case. We can
also remove the flag itself since nobody else uses it.
Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
Acked-by: Roland McGrath <roland@redhat.com>
Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
01b8b07a5d
commit
6b39c7bfbd
4 changed files with 3 additions and 22 deletions
|
@ -1514,18 +1514,7 @@ static int wait_task_continued(struct task_struct *p, int noreap,
|
|||
|
||||
static inline int my_ptrace_child(struct task_struct *p)
|
||||
{
|
||||
if (!(p->ptrace & PT_PTRACED))
|
||||
return 0;
|
||||
if (!(p->ptrace & PT_ATTACHED))
|
||||
return 1;
|
||||
/*
|
||||
* This child was PTRACE_ATTACH'd. We should be seeing it only if
|
||||
* we are the attacher. If we are the real parent, this is a race
|
||||
* inside ptrace_attach. It is waiting for the tasklist_lock,
|
||||
* which we have to switch the parent links, but has already set
|
||||
* the flags in p->ptrace.
|
||||
*/
|
||||
return (p->parent != p->real_parent);
|
||||
return p->ptrace & PT_PTRACED;
|
||||
}
|
||||
|
||||
static long do_wait(pid_t pid, int options, struct siginfo __user *infop,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue