Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

serial: do not accept sysrq characters via serial port

many embedded boards have a disconnected TTL level serial which can
generate some garbage that can lead to spurious false sysrq detects.

Signed-off-by: John Crispin <john@phrozen.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Felix Fietkau and committed by
Greg Kroah-Hartman
732dbf3a 552df698

+11 -1
+1 -1
include/linux/serial_core.h
··· 450 450 extern void uart_insert_char(struct uart_port *port, unsigned int status, 451 451 unsigned int overrun, unsigned int ch, unsigned int flag); 452 452 453 - #ifdef SUPPORT_SYSRQ 453 + #if defined(SUPPORT_SYSRQ) && defined(CONFIG_MAGIC_SYSRQ_SERIAL) 454 454 static inline int 455 455 uart_handle_sysrq_char(struct uart_port *port, unsigned int ch) 456 456 {
+10
lib/Kconfig.debug
··· 416 416 This may be set to 1 or 0 to enable or disable them all, or 417 417 to a bitmask as described in Documentation/sysrq.txt. 418 418 419 + config MAGIC_SYSRQ_SERIAL 420 + bool "Enable magic SysRq key over serial" 421 + depends on MAGIC_SYSRQ 422 + default y 423 + help 424 + Many embedded boards have a disconnected TTL level serial which can 425 + generate some garbage that can lead to spurious false sysrq detects. 426 + This option allows you to decide whether you want to enable the 427 + magic SysRq key. 428 + 419 429 config DEBUG_KERNEL 420 430 bool "Kernel debugging" 421 431 help