summaryrefslogtreecommitdiff
path: root/kernel/sched.c
diff options
context:
space:
mode:
authorOleg Nesterov <oleg@redhat.com>2010-05-26 14:43:17 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2010-05-27 09:12:46 -0700
commit4ada856fb0ee62f6fe3aac3de726deac0640d929 (patch)
tree8dd3efbc19f6e1f1dac2ff7afdcd9658fb08b814 /kernel/sched.c
parentea6d290ca34c4fd91b7348338c0cc7bdeff94a35 (diff)
signals: clear signal->tty when the last thread exits
When the last thread exits signal->tty is freed, but the pointer is not cleared and points to nowhere. This is OK. Nobody should use signal->tty lockless, and it is no longer possible to take ->siglock. However this looks wrong even if correct, and the nice OOPS is better than subtle and hard to find bugs. Change __exit_signal() to clear signal->tty under ->siglock. Note: __exit_signal() needs more cleanups. It should not check "sig != NULL" to detect the all-dead case and we have the same issues with signal->stats. Signed-off-by: Oleg Nesterov <oleg@redhat.com> Cc: Alan Cox <alan@linux.intel.com> Cc: Ingo Molnar <mingo@elte.hu> Acked-by: Peter Zijlstra <peterz@infradead.org> Acked-by: Roland McGrath <roland@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/sched.c')
0 files changed, 0 insertions, 0 deletions