From: Heinrich Schuchardt <xypron.glpk@gmx.de>
Date: Mon, 5 Jul 2021 17:43:00 +0000 (+0200)
Subject: sandbox: don't set SA_NODEFER in signal handler
X-Git-Tag: v2025.01-rc5-pxa1908~1785^2~1
X-Git-Url: http://git.dujemihanovic.xyz/img/login.html?a=commitdiff_plain;h=fd25ca3275946476d5c3fa32e3e7e3087fa5c572;p=u-boot.git

sandbox: don't set SA_NODEFER in signal handler

The sandbox can handle signals. Due to a damaged global data pointer
additional exceptions in the signal handler may occur leading to an endless
loop. In this case leave the handling of the secondary exception to the
operating system.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
---

diff --git a/arch/sandbox/cpu/os.c b/arch/sandbox/cpu/os.c
index a8aa9def27..1103530941 100644
--- a/arch/sandbox/cpu/os.c
+++ b/arch/sandbox/cpu/os.c
@@ -226,7 +226,7 @@ int os_setup_signal_handlers(void)
 
 	act.sa_sigaction = os_signal_handler;
 	sigemptyset(&act.sa_mask);
-	act.sa_flags = SA_SIGINFO | SA_NODEFER;
+	act.sa_flags = SA_SIGINFO;
 	if (sigaction(SIGILL, &act, NULL) ||
 	    sigaction(SIGBUS, &act, NULL) ||
 	    sigaction(SIGSEGV, &act, NULL))