Commit 92285fc4 authored by Daniel Jacobowitz's avatar Daniel Jacobowitz Committed by Greg Kroah-Hartman

[PATCH] ptrace exit fix

Gotta ptrace_unlink before calling release_task, and instead of fiddling
with the real_parent directly.
parent 3c9bd375
...@@ -712,15 +712,19 @@ asmlinkage long sys_wait4(pid_t pid,unsigned int * stat_addr, int options, struc ...@@ -712,15 +712,19 @@ asmlinkage long sys_wait4(pid_t pid,unsigned int * stat_addr, int options, struc
if (retval) if (retval)
goto end_wait4; goto end_wait4;
retval = p->pid; retval = p->pid;
if (p->real_parent != p->parent || p->ptrace) { if (p->real_parent != p->parent) {
write_lock_irq(&tasklist_lock); write_lock_irq(&tasklist_lock);
remove_parent(p); ptrace_unlink(p);
p->parent = p->real_parent;
add_parent(p, p->parent);
do_notify_parent(p, SIGCHLD); do_notify_parent(p, SIGCHLD);
write_unlock_irq(&tasklist_lock); write_unlock_irq(&tasklist_lock);
} else } else {
if (p->ptrace) {
write_lock_irq(&tasklist_lock);
ptrace_unlink(p);
write_unlock_irq(&tasklist_lock);
}
release_task(p); release_task(p);
}
goto end_wait4; goto end_wait4;
default: default:
continue; continue;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment