Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

wait_task_stopped: Check p->exit_state instead of TASK_TRACED

The original meaning of the old test (p->state > TASK_STOPPED) was
"not dead", since it was before TASK_TRACED existed and before the
state/exit_state split. It was a wrong correction in commit
14bf01bb0599c89fc7f426d20353b76e12555308 to make this test for
TASK_TRACED instead. It should have been changed when TASK_TRACED
was introducted and again when exit_state was introduced.

Signed-off-by: Roland McGrath <roland@redhat.com>
Cc: Oleg Nesterov <oleg@tv-sign.ru>
Cc: Alexey Dobriyan <adobriyan@sw.ru>
Cc: Kees Cook <kees@ubuntu.com>
Acked-by: Scott James Remnant <scott@ubuntu.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Roland McGrath and committed by
Linus Torvalds
a3474224 99fee6d7

+1 -2
+1 -2
kernel/exit.c
··· 1386 1386 int why = (p->ptrace & PT_PTRACED) ? CLD_TRAPPED : CLD_STOPPED; 1387 1387 1388 1388 exit_code = p->exit_code; 1389 - if (unlikely(!exit_code) || 1390 - unlikely(p->state & TASK_TRACED)) 1389 + if (unlikely(!exit_code) || unlikely(p->exit_state)) 1391 1390 goto bail_ref; 1392 1391 return wait_noreap_copyout(p, pid, uid, 1393 1392 why, (exit_code << 8) | 0x7f,