diff options
Diffstat (limited to 'kernel/exit.c')
-rw-r--r-- | kernel/exit.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/kernel/exit.c b/kernel/exit.c index 6ef8f7356a74..2d39ccc367e6 100644 --- a/kernel/exit.c +++ b/kernel/exit.c | |||
@@ -1383,6 +1383,15 @@ repeat: | |||
1383 | 1383 | ||
1384 | switch (p->state) { | 1384 | switch (p->state) { |
1385 | case TASK_TRACED: | 1385 | case TASK_TRACED: |
1386 | /* | ||
1387 | * When we hit the race with PTRACE_ATTACH, | ||
1388 | * we will not report this child. But the | ||
1389 | * race means it has not yet been moved to | ||
1390 | * our ptrace_children list, so we need to | ||
1391 | * set the flag here to avoid a spurious ECHILD | ||
1392 | * when the race happens with the only child. | ||
1393 | */ | ||
1394 | flag = 1; | ||
1386 | if (!my_ptrace_child(p)) | 1395 | if (!my_ptrace_child(p)) |
1387 | continue; | 1396 | continue; |
1388 | /*FALLTHROUGH*/ | 1397 | /*FALLTHROUGH*/ |