Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 139687
b: refs/heads/master
c: 95c3eb7
h: refs/heads/master
i:
  139685: de14485
  139683: 3c8813d
  139679: f03449f
v: v3
  • Loading branch information
Oleg Nesterov authored and Linus Torvalds committed Apr 3, 2009
1 parent 47733fa commit 0488aae
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 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: 6588c1e3ff01418acafd938db0740e3477dc8cb7
refs/heads/master: 95c3eb76dc07fd81289888ffc42948196b34b444
22 changes: 9 additions & 13 deletions trunk/kernel/ptrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -235,16 +235,6 @@ int ptrace_attach(struct task_struct *task)
return retval;
}

static inline void __ptrace_detach(struct task_struct *child, unsigned int data)
{
child->exit_code = data;
/* .. re-parent .. */
__ptrace_unlink(child);
/* .. and wake it up. */
if (child->exit_state != EXIT_ZOMBIE)
wake_up_process(child);
}

int ptrace_detach(struct task_struct *child, unsigned int data)
{
if (!valid_signal(data))
Expand All @@ -254,10 +244,16 @@ int ptrace_detach(struct task_struct *child, unsigned int data)
ptrace_disable(child);
clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);

write_lock_irq(&tasklist_lock);
/* protect against de_thread()->release_task() */
if (child->ptrace)
__ptrace_detach(child, data);
write_lock_irq(&tasklist_lock);
if (child->ptrace) {
child->exit_code = data;

__ptrace_unlink(child);

if (!child->exit_state)
wake_up_process(child);
}
write_unlock_irq(&tasklist_lock);

return 0;
Expand Down

0 comments on commit 0488aae

Please sign in to comment.