Skip to content

Commit 3a9f84d

Browse files
Ed SwierkIngo Molnar
Ed Swierk
authored and
Ingo Molnar
committed
signals, debug: fix BUG: using smp_processor_id() in preemptible code in print_fatal_signal()
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 <[email protected]> Signed-off-by: Ingo Molnar <[email protected]>
1 parent bf50c90 commit 3a9f84d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

kernel/signal.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -909,7 +909,9 @@ static void print_fatal_signal(struct pt_regs *regs, int signr)
909909
}
910910
#endif
911911
printk("\n");
912+
preempt_disable();
912913
show_regs(regs);
914+
preempt_enable();
913915
}
914916

915917
static int __init setup_print_fatal_signals(char *str)

0 commit comments

Comments
 (0)