arm64: signal: don't force known signals to SIGKILL
authorMark Rutland <mark.rutland@arm.com>
Mon, 16 Apr 2018 15:45:01 +0000 (16:45 +0100)
committerCatalin Marinas <catalin.marinas@arm.com>
Wed, 18 Apr 2018 14:13:27 +0000 (15:13 +0100)
Since commit:

  a7e6f1ca90354a31 ("arm64: signal: Force SIGKILL for unknown signals in force_signal_inject")

... any signal which is not SIGKILL will be upgraded to a SIGKILL be
force_signal_inject(). This includes signals we do expect, such as
SIGILL triggered by do_undefinstr().

Fix the check to use a logical AND rather than a logical OR, permitting
signals whose layout is SIL_FAULT.

Fixes: a7e6f1ca90354a31 ("arm64: signal: Force SIGKILL for unknown signals in force_signal_inject")
Cc: Will Deacon <will.deacon@arm.com>
Reviewed-by: Dave Martin <Dave.Martin@arm.com>
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/kernel/traps.c

index ba964da31a252dd2ea517b2b7a4dcef06daa0f7b..1cb2749a72bfed65cd33d3a24695ddef2bbce517 100644 (file)
@@ -366,7 +366,7 @@ void force_signal_inject(int signal, int code, unsigned long address)
        }
 
        /* Force signals we don't understand to SIGKILL */
-       if (WARN_ON(signal != SIGKILL ||
+       if (WARN_ON(signal != SIGKILL &&
                    siginfo_layout(signal, code) != SIL_FAULT)) {
                signal = SIGKILL;
        }