signals, debug: fix BUG: using smp_processor_id() in preemptible code in print_fatal_...
authorEd Swierk <eswierk@aristanetworks.com>
Mon, 26 Jan 2009 23:33:31 +0000 (15:33 -0800)
committerIngo Molnar <mingo@elte.hu>
Mon, 26 Jan 2009 23:36:19 +0000 (00:36 +0100)
With print-fatal-signals=1 on a kernel with CONFIG_PREEMPT=y, sending an
unexpected signal to a process causes a BUG: using smp_processor_id() in
preemptible code.

get_signal_to_deliver() releases the siglock before calling
print_fatal_signal(), which calls show_regs(), which calls
smp_processor_id(), which is not supposed to be called from a
preemptible thread.

Make sure show_regs() runs with preemption disabled.

Signed-off-by: Ed Swierk <eswierk@aristanetworks.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
kernel/signal.c

index e73759783dc84d8134c9e5603432d0729d4634a3..b6b36768b758901b2d1806839a8c6b6c5ee035e0 100644 (file)
@@ -909,7 +909,9 @@ static void print_fatal_signal(struct pt_regs *regs, int signr)
        }
 #endif
        printk("\n");
+       preempt_disable();
        show_regs(regs);
+       preempt_enable();
 }
 
 static int __init setup_print_fatal_signals(char *str)