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
if (retval)
goto end_wait4;
retval = p->pid;
if (p->real_parent != p->parent || p->ptrace) {
if (p->real_parent != p->parent) {
write_lock_irq(&tasklist_lock);
remove_parent(p);
p->parent = p->real_parent;
add_parent(p, p->parent);
ptrace_unlink(p);
do_notify_parent(p, SIGCHLD);
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);
}
goto end_wait4;
default:
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