• Jeremy Kerr's avatar
    [PATCH] Fix signal race during process exit · 651bea8c
    Jeremy Kerr authored
    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: default avatarAndrew Morton <akpm@osdl.org>
    Signed-off-by: default avatarJeremy Kerr <jk@ozlabs.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    651bea8c
exit.c 29.3 KB