• Petr Vandrovec's avatar
    [PATCH] Fix potential runqueue deadlock · b36c92e7
    Petr Vandrovec authored
    send_sig_info() has been broken since 2.5.60.
    
    The function can be invoked from a the time interrupt (timer_interrpt ->
    do_timer -> update_process_times -> -> update_one_process -> (
    do_process_times, do_it_prof, do_it_virt ) -> -> send_sig ->
    send_sig_info) but it uses spin_unlock_irq instead of the correct
    spin_unlock_irqrestore. 
    
    This enables interrupts, and later scheduler_tick() locks runqueue
    (without disabling interrupts).  And if we are unlucky, a new interrupt
    comes at this point.  And if this interrupt tries to do wake_up() (like
    RTC interrupt does), we will deadlock on runqueue lock :-(
    
    The bug was introduced by signal-fixes-2.5.59-A4, which split the
    original send_sig_info into two functions, and in one branch it started
    using these unsafe spinlock variants (while the "group" variant uses
    irqsave/restore correctly). 
    b36c92e7
signal.c 57.4 KB