[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 10/10] linux-user: Detect and report host SIGILL, SIGFPE, SIGT
From: |
Richard Henderson |
Subject: |
[PATCH v4 10/10] linux-user: Detect and report host SIGILL, SIGFPE, SIGTRAP |
Date: |
Tue, 22 Aug 2023 22:16:15 -0700 |
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 --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);
}
}
--
2.34.1
- Re: [PATCH v4 01/10] linux-user: Split out die_with_signal, (continued)
- [PATCH v4 02/10] linux-user: Exit not abort in die_with_backtrace, Richard Henderson, 2023/08/23
- [PATCH v4 03/10] linux-user: Use die_with_signal with abort, Richard Henderson, 2023/08/23
- [PATCH v4 04/10] linux-user: Detect and report host crashes, Richard Henderson, 2023/08/23
- [PATCH v4 05/10] linux-user: Only register handlers for core_dump_signal by default, Richard Henderson, 2023/08/23
- [PATCH v4 07/10] linux-user: Remap SIGPROF when CONFIG_GPROF, Richard Henderson, 2023/08/23
- [PATCH v4 08/10] linux-user: Simplify signal_init, Richard Henderson, 2023/08/23
- [PATCH v4 06/10] linux-user: Map unsupported signals to an out-of-bounds value, Richard Henderson, 2023/08/23
- [PATCH v4 09/10] linux-user: Split out host_sig{segv,bus}_handler, Richard Henderson, 2023/08/23
- [PATCH v4 10/10] linux-user: Detect and report host SIGILL, SIGFPE, SIGTRAP,
Richard Henderson <=