]> git.hungrycats.org Git - linux/commit
[PATCH] Fix signal race during process exit
authorJeremy Kerr <jeremy@redfishsoftware.com.au>
Wed, 2 Jun 2004 00:18:12 +0000 (17:18 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Wed, 2 Jun 2004 00:18:12 +0000 (17:18 -0700)
commit651bea8c072b9ab412719f69a5e76bc91f3124cc
treea1dd8804b285848ac5f85b695339ab09bf5242a8
parent8012a7f767b59fca384aad773b0cd87ccecc6ad9
[PATCH] Fix signal race during process exit

Fix a race identified by Jeremy Kerr <jeremy@redfishsoftware.com.au>: if
update_process_times() decides to deliver a signal due to process timer
expiry, it can race with __exit_sighand()'s freeing of task->sighand.

Fix that by clearing the per-process timer state in exit_notify(), while under
local_irq_disable() and under tasklist_lock.  tasklist_lock provides exclusion
wrt release_task()'s freeing of task->sighand and local_irq_disable() provides
exclusion wrt update_process_times()'s inspection of the per-process timer
state.

We also need to deal with the send_sig() calls in do_process_times() by
setting rlim_cur to RLIM_INFINITY.

Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
kernel/exit.c