From ff974bd5d1883fd5f48ff11372e9760d8d05a141 Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Sat, 13 Apr 2024 19:42:12 -0400 Subject: kernel: signal: Fix deadlock in signal_handle() Signed-off-by: Ian Moffett --- sys/kern/kern_signal.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sys') diff --git a/sys/kern/kern_signal.c b/sys/kern/kern_signal.c index 96c02a5..7c31c86 100644 --- a/sys/kern/kern_signal.c +++ b/sys/kern/kern_signal.c @@ -56,12 +56,13 @@ signal_handle(struct proc *curtd) { int signo = curtd->signal; - spinlock_acquire(&curtd->lock); if (signo == 0) { return; } + spinlock_acquire(&curtd->lock); curtd->signal = 0; + switch (signo) { case SIGFPE: signal_log("Arithmetic error\n"); -- cgit v1.2.3