diff --git a/[refs] b/[refs] index 62c4a253217b..e44620dbce94 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 396dc44bcac58f464b7b23c345052e37881cccea +refs/heads/master: 7f2a52555998c699a7e89f24636c909d6fc08a60 diff --git a/trunk/kernel/exit.c b/trunk/kernel/exit.c index 6ef8f7356a74..2d39ccc367e6 100644 --- a/trunk/kernel/exit.c +++ b/trunk/kernel/exit.c @@ -1383,6 +1383,15 @@ static long do_wait(pid_t pid, int options, struct siginfo __user *infop, switch (p->state) { case TASK_TRACED: + /* + * When we hit the race with PTRACE_ATTACH, + * we will not report this child. But the + * race means it has not yet been moved to + * our ptrace_children list, so we need to + * set the flag here to avoid a spurious ECHILD + * when the race happens with the only child. + */ + flag = 1; if (!my_ptrace_child(p)) continue; /*FALLTHROUGH*/