From c1ab060dd461e236cd66bfdde04a586b0e81b46e Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 2 Mar 2020 09:03:35 +0100 Subject: [PATCH] 4.14-stable patches added patches: sysrq-remove-duplicated-sysrq-message.patch sysrq-restore-original-console_loglevel-when-sysrq-disabled.patch --- queue-4.14/series | 2 + ...ysrq-remove-duplicated-sysrq-message.patch | 55 +++++++++++++++++++ ...console_loglevel-when-sysrq-disabled.patch | 37 +++++++++++++ 3 files changed, 94 insertions(+) create mode 100644 queue-4.14/sysrq-remove-duplicated-sysrq-message.patch create mode 100644 queue-4.14/sysrq-restore-original-console_loglevel-when-sysrq-disabled.patch diff --git a/queue-4.14/series b/queue-4.14/series index df32bfbb916..31bcbd8a5d7 100644 --- a/queue-4.14/series +++ b/queue-4.14/series @@ -23,3 +23,5 @@ net-ena-ena-com.c-prevent-null-pointer-dereference.patch cifs-fix-mode-output-in-debugging-statements.patch bcache-ignore-pending-signals-when-creating-gc-and-a.patch cfg80211-add-missing-policy-for-nl80211_attr_status_.patch +sysrq-restore-original-console_loglevel-when-sysrq-disabled.patch +sysrq-remove-duplicated-sysrq-message.patch diff --git a/queue-4.14/sysrq-remove-duplicated-sysrq-message.patch b/queue-4.14/sysrq-remove-duplicated-sysrq-message.patch new file mode 100644 index 00000000000..8974e341340 --- /dev/null +++ b/queue-4.14/sysrq-remove-duplicated-sysrq-message.patch @@ -0,0 +1,55 @@ +From c3fee60908db4a8594f2e4a2131998384b8fa006 Mon Sep 17 00:00:00 2001 +From: Petr Mladek +Date: Fri, 11 Jan 2019 17:20:37 +0100 +Subject: sysrq: Remove duplicated sysrq message + +From: Petr Mladek + +commit c3fee60908db4a8594f2e4a2131998384b8fa006 upstream. + +The commit 97f5f0cd8cd0a0544 ("Input: implement SysRq as a separate input +handler") added pr_fmt() definition. It caused a duplicated message +prefix in the sysrq header messages, for example: + +[ 177.053931] sysrq: SysRq : Show backtrace of all active CPUs +[ 742.864776] sysrq: SysRq : HELP : loglevel(0-9) reboot(b) crash(c) + +Fixes: 97f5f0cd8cd0a05 ("Input: implement SysRq as a separate input handler") +Signed-off-by: Petr Mladek +Reviewed-by: Sergey Senozhatsky +Cc: Tommi Rantala +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/tty/sysrq.c | 7 +++---- + 1 file changed, 3 insertions(+), 4 deletions(-) + +--- a/drivers/tty/sysrq.c ++++ b/drivers/tty/sysrq.c +@@ -546,7 +546,6 @@ void __handle_sysrq(int key, bool check_ + */ + orig_log_level = console_loglevel; + console_loglevel = CONSOLE_LOGLEVEL_DEFAULT; +- pr_info("SysRq : "); + + op_p = __sysrq_get_key_op(key); + if (op_p) { +@@ -555,15 +554,15 @@ void __handle_sysrq(int key, bool check_ + * should not) and is the invoked operation enabled? + */ + if (!check_mask || sysrq_on_mask(op_p->enable_mask)) { +- pr_cont("%s\n", op_p->action_msg); ++ pr_info("%s\n", op_p->action_msg); + console_loglevel = orig_log_level; + op_p->handler(key); + } else { +- pr_cont("This sysrq operation is disabled.\n"); ++ pr_info("This sysrq operation is disabled.\n"); + console_loglevel = orig_log_level; + } + } else { +- pr_cont("HELP : "); ++ pr_info("HELP : "); + /* Only print the help msg once per handler */ + for (i = 0; i < ARRAY_SIZE(sysrq_key_table); i++) { + if (sysrq_key_table[i]) { diff --git a/queue-4.14/sysrq-restore-original-console_loglevel-when-sysrq-disabled.patch b/queue-4.14/sysrq-restore-original-console_loglevel-when-sysrq-disabled.patch new file mode 100644 index 00000000000..b6b8802cb86 --- /dev/null +++ b/queue-4.14/sysrq-restore-original-console_loglevel-when-sysrq-disabled.patch @@ -0,0 +1,37 @@ +From 075e1a0c50f59ea210561d0d0fedbd945615df78 Mon Sep 17 00:00:00 2001 +From: Petr Mladek +Date: Fri, 11 Jan 2019 13:45:15 +0100 +Subject: sysrq: Restore original console_loglevel when sysrq disabled + +From: Petr Mladek + +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 +Reviewed-by: Sergey Senozhatsky +Reviewed-by: Steven Rostedt (VMware) +Cc: Tommi Rantala +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/tty/sysrq.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/tty/sysrq.c ++++ b/drivers/tty/sysrq.c +@@ -560,6 +560,7 @@ void __handle_sysrq(int key, bool check_ + op_p->handler(key); + } else { + pr_cont("This sysrq operation is disabled.\n"); ++ console_loglevel = orig_log_level; + } + } else { + pr_cont("HELP : "); -- 2.47.3