Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 84646
b: refs/heads/master
c: 6b39c7b
h: refs/heads/master
v: v3
  • Loading branch information
Oleg Nesterov authored and Linus Torvalds committed Feb 8, 2008
1 parent 98432c9 commit 6b85106
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 23 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 01b8b07a5d77d22e609267dcae74d15e3e9c5f13
refs/heads/master: 6b39c7bfbd1436836c0fb34c5b437fda1a7a3dd4
1 change: 0 additions & 1 deletion trunk/include/linux/ptrace.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@
#define PT_TRACE_EXEC 0x00000080
#define PT_TRACE_VFORK_DONE 0x00000100
#define PT_TRACE_EXIT 0x00000200
#define PT_ATTACHED 0x00000400 /* parent != real_parent */

#define PT_TRACE_MASK 0x000003f4

Expand Down
13 changes: 1 addition & 12 deletions trunk/kernel/exit.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 2 additions & 4 deletions trunk/kernel/ptrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,7 @@ int ptrace_check_attach(struct task_struct *child, int kill)
*/
read_lock(&tasklist_lock);
if ((child->ptrace & PT_PTRACED) && child->parent == current &&
(!(child->ptrace & PT_ATTACHED) || child->real_parent != current)
&& child->signal != NULL) {
child->signal != NULL) {
ret = 0;
spin_lock_irq(&child->sighand->siglock);
if (task_is_stopped(child))
Expand Down Expand Up @@ -200,8 +199,7 @@ int ptrace_attach(struct task_struct *task)
goto bad;

/* Go */
task->ptrace |= PT_PTRACED | ((task->real_parent != current)
? PT_ATTACHED : 0);
task->ptrace |= PT_PTRACED;
if (capable(CAP_SYS_PTRACE))
task->ptrace |= PT_PTRACE_CAP;

Expand Down
5 changes: 0 additions & 5 deletions trunk/kernel/signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -1556,11 +1556,6 @@ static inline int may_ptrace_stop(void)
{
if (!likely(current->ptrace & PT_PTRACED))
return 0;

if (unlikely(current->parent == current->real_parent &&
(current->ptrace & PT_ATTACHED)))
return 0;

/*
* Are we in the middle of do_coredump?
* If so and our tracer is also part of the coredump stopping
Expand Down

0 comments on commit 6b85106

Please sign in to comment.