From f84fbbcf246a7e726db1eac141b619fcb498e162 Mon Sep 17 00:00:00 2001 From: Petr Mladek Date: Wed, 13 Mar 2019 10:27:35 +0800 Subject: [PATCH] sysrq: Restore original console_loglevel when sysrq disabled mainline inclusion from mainline-5.0 commit 075e1a0c50f59 category: bugfix bugzilla: 11848 CVE: NA ------------------------------------------------- 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 Reviewed-by: Sergey Senozhatsky Reviewed-by: Steven Rostedt (VMware) Signed-off-by: Greg Kroah-Hartman Signed-off-by: Hongbo Yao Reviewed-by: Yang Yingliang Signed-off-by: Yang Yingliang --- drivers/tty/sysrq.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/tty/sysrq.c b/drivers/tty/sysrq.c index ad1ee5d01b53..4a0c2693b43a 100644 --- a/drivers/tty/sysrq.c +++ b/drivers/tty/sysrq.c @@ -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 : "); -- GitLab