[PATCH 2/9] arm64: signal: Force SIGKILL for unknown signals in force_signal_inject
Will Deacon
will.deacon at arm.com
Thu Feb 22 06:00:50 PST 2018
For signals other than SIGKILL or those with siginfo_layout(signal, code)
== SIL_FAULT then force_signal_inject does not initialise the siginfo_t
properly. Since the signal number is determined solely by the caller,
simply WARN on unknown signals and force to SIGKILL.
Reported-by: Dave Martin <Dave.Martin at arm.com>
Signed-off-by: Will Deacon <will.deacon at arm.com>
---
arch/arm64/kernel/traps.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/arch/arm64/kernel/traps.c b/arch/arm64/kernel/traps.c
index c478d8e27649..3f52c07b4bf4 100644
--- a/arch/arm64/kernel/traps.c
+++ b/arch/arm64/kernel/traps.c
@@ -331,6 +331,12 @@ void force_signal_inject(int signal, int code, unsigned long address)
break;
}
+ /* Force signals we don't understand to SIGKILL */
+ if (WARN_ON(signal != SIGKILL ||
+ siginfo_layout(signal, code) != SIL_FAULT)) {
+ signal = SIGKILL;
+ }
+
if (unhandled_signal(current, signal) &&
show_unhandled_signals_ratelimited()) {
pr_info("%s[%d]: %s: pc=%08llx\n",
--
2.1.4
More information about the linux-arm-kernel
mailing list