]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
sysrq: Restore original console_loglevel when sysrq disabled
authorPetr Mladek <pmladek@suse.com>
Fri, 11 Jan 2019 12:45:15 +0000 (13:45 +0100)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Tue, 7 Apr 2020 08:50:57 +0000 (10:50 +0200)
BugLink: https://bugs.launchpad.net/bugs/1868623
commit 075e1a0c50f59ea210561d0d0fedbd945615df78 upstream.

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>
Cc: Tommi Rantala <tommi.t.rantala@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/tty/sysrq.c

index b674793be478442874a7ca62de1aeccc8ae3c50e..afc3b354347c86513a930519ad3a91e7b351d0a6 100644 (file)
@@ -560,6 +560,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 : ");