sysrq: Restore original console_loglevel when sysrq disabled
authorPetr Mladek <pmladek@suse.com>
Fri, 11 Jan 2019 12:45:15 +0000 (13:45 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 22 Jan 2019 12:46:53 +0000 (13:46 +0100)
The sysrq header line is printed with an increased loglevel
to provide users some positive feedback.

The original loglevel is not restored when the sysrq operation
is disabled. This bug was introduced in 2.6.12 (pre-git-history)
by the commit ("Allow admin to enable only some of the Magic-Sysrq
functions").

Signed-off-by: Petr Mladek <pmladek@suse.com>
Reviewed-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Reviewed-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/sysrq.c

index 1f03078..2e4e184 100644 (file)
@@ -553,6 +553,7 @@ void __handle_sysrq(int key, bool check_mask)
                        op_p->handler(key);
                } else {
                        pr_cont("This sysrq operation is disabled.\n");
+                       console_loglevel = orig_log_level;
                }
        } else {
                pr_cont("HELP : ");