diff options
| author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-01-19 07:02:50 +0800 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-01-19 07:02:50 +0800 |
| commit | 61b6b7fbda1bcef6d3df6b789e6bb178ee83d3d8 (patch) | |
| tree | ed23eb87f0b1152118985f93a5f19ef66629bb9e /kernel/exit.c | |
| parent | 4c215fe8e288c87b34c3d5bc910c77af586859d2 (diff) | |
| parent | ec6f34e5b552fb0a52e6aae1a5afbbb1605cc6cc (diff) | |
| download | cachepc-linux-61b6b7fbda1bcef6d3df6b789e6bb178ee83d3d8.tar.gz cachepc-linux-61b6b7fbda1bcef6d3df6b789e6bb178ee83d3d8.zip | |
Merge 3.19-rc5 into tty-next
We want those tty fixes in that release in this branch as well.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'kernel/exit.c')
| -rw-r--r-- | kernel/exit.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/kernel/exit.c b/kernel/exit.c index 1ea4369890a3..6806c55475ee 100644 --- a/kernel/exit.c +++ b/kernel/exit.c @@ -1287,9 +1287,15 @@ static int wait_task_continued(struct wait_opts *wo, struct task_struct *p) static int wait_consider_task(struct wait_opts *wo, int ptrace, struct task_struct *p) { + /* + * We can race with wait_task_zombie() from another thread. + * Ensure that EXIT_ZOMBIE -> EXIT_DEAD/EXIT_TRACE transition + * can't confuse the checks below. + */ + int exit_state = ACCESS_ONCE(p->exit_state); int ret; - if (unlikely(p->exit_state == EXIT_DEAD)) + if (unlikely(exit_state == EXIT_DEAD)) return 0; ret = eligible_child(wo, p); @@ -1310,7 +1316,7 @@ static int wait_consider_task(struct wait_opts *wo, int ptrace, return 0; } - if (unlikely(p->exit_state == EXIT_TRACE)) { + if (unlikely(exit_state == EXIT_TRACE)) { /* * ptrace == 0 means we are the natural parent. In this case * we should clear notask_error, debugger will notify us. @@ -1337,7 +1343,7 @@ static int wait_consider_task(struct wait_opts *wo, int ptrace, } /* slay zombie? */ - if (p->exit_state == EXIT_ZOMBIE) { + if (exit_state == EXIT_ZOMBIE) { /* we don't reap group leaders with subthreads */ if (!delay_group_leader(p)) { /* |
