1 From: John Crispin <john@phrozen.org>
2 Subject: serial: do not accept sysrq characters via serial port
4 many embedded boards have a disconnected TTL level serial which can
5 generate some garbage that can lead to spurious false sysrq detects.
7 [john@phrozen.org: sent upstream 22.12.2016]
9 Signed-off-by: John Crispin <john@phrozen.org>
10 Signed-off-by: Felix Fietkau <nbd@nbd.name>
12 include/linux/serial_core.h | 2 +-
13 lib/Kconfig.debug | 5 +++++
14 2 files changed, 6 insertions(+), 1 deletion(-)
16 --- a/include/linux/serial_core.h
17 +++ b/include/linux/serial_core.h
18 @@ -457,7 +457,7 @@ extern void uart_handle_cts_change(struc
19 extern void uart_insert_char(struct uart_port *port, unsigned int status,
20 unsigned int overrun, unsigned int ch, unsigned int flag);
23 +#if defined(SUPPORT_SYSRQ) && defined(CONFIG_MAGIC_SYSRQ_SERIAL)
25 uart_handle_sysrq_char(struct uart_port *port, unsigned int ch)
27 --- a/lib/Kconfig.debug
28 +++ b/lib/Kconfig.debug
29 @@ -410,6 +410,11 @@ config MAGIC_SYSRQ_DEFAULT_ENABLE
30 This may be set to 1 or 0 to enable or disable them all, or
31 to a bitmask as described in Documentation/sysrq.txt.
33 +config MAGIC_SYSRQ_SERIAL
34 + bool "Enable magic SysRq key over serial"
35 + depends on MAGIC_SYSRQ
39 bool "Kernel debugging"