Browse Source

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>
Will Deacon 7 năm trước cách đây
mục cha
commit
a7e6f1ca90
1 tập tin đã thay đổi với 6 bổ sung0 xóa
  1. 6 0
      arch/arm64/kernel/traps.c

+ 6 - 0
arch/arm64/kernel/traps.c

@@ -331,6 +331,12 @@ void force_signal_inject(int signal, int code, unsigned long address)
 		break;
 		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) &&
 	if (unhandled_signal(current, signal) &&
 	    show_unhandled_signals_ratelimited()) {
 	    show_unhandled_signals_ratelimited()) {
 		pr_info("%s[%d]: %s: pc=%08llx\n",
 		pr_info("%s[%d]: %s: pc=%08llx\n",