diff options
author | Will Deacon <will.deacon@arm.com> | 2018-02-20 19:08:40 +0100 |
---|---|---|
committer | Will Deacon <will.deacon@arm.com> | 2018-03-06 19:52:23 +0100 |
commit | a7e6f1ca90354a31946873d102cfa999ddf6ecb4 (patch) | |
tree | 0e8b4ebdcf42eea29d6dda35fa56be2f9b5e280c /arch/arm64/kernel/traps.c | |
parent | arm64: signal: Make force_signal_inject more robust (diff) | |
download | linux-a7e6f1ca90354a31946873d102cfa999ddf6ecb4.tar.xz linux-a7e6f1ca90354a31946873d102cfa999ddf6ecb4.zip |
arm64: signal: Force SIGKILL for unknown signals in force_signal_inject
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@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to '')
-rw-r--r-- | arch/arm64/kernel/traps.c | 6 |
1 files changed, 6 insertions, 0 deletions
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", |