diff mbox series

[v4,10/10] linux-user: Detect and report host SIGILL, SIGFPE, SIGTRAP

Message ID 20230823051615.1297706-11-richard.henderson@linaro.org
State New
Headers show
Series linux-user: Detect and report host crashes | expand

Commit Message

Richard Henderson Aug. 23, 2023, 5:16 a.m. UTC
These signals, when not spoofed via kill(), are always bugs.
Use die_with_backtrace to report this sensibly.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/signal.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/linux-user/signal.c b/linux-user/signal.c
index 68ceb2e4bd..6d13b5c210 100644
--- a/linux-user/signal.c
+++ b/linux-user/signal.c
@@ -904,7 +904,8 @@  static void host_signal_handler(int host_sig, siginfo_t *info, void *puc)
 
     /*
      * Non-spoofed SIGSEGV and SIGBUS are synchronous, and need special
-     * handling wrt signal blocking and unwinding.
+     * handling wrt signal blocking and unwinding.  Non-spoofed SIGILL,
+     * SIGFPE, SIGTRAP are always host bugs.
      */
     if (info->si_code > 0) {
         switch (host_sig) {
@@ -916,6 +917,10 @@  static void host_signal_handler(int host_sig, siginfo_t *info, void *puc)
             host_sigbus_handler(cpu, info, uc);
             sync_sig = true;
             break;
+        case SIGILL:
+        case SIGFPE:
+        case SIGTRAP:
+            die_with_backtrace(info);
         }
     }