lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1438255732-31326-1-git-send-email-pmladek@suse.com>
Date:	Thu, 30 Jul 2015 13:28:52 +0200
From:	Petr Mladek <pmladek@...e.com>
To:	akpm@...ux-foundation.org, Tejun Heo <tj@...nel.org>
Cc:	davem@...emloft.net, linux-kernel@...r.kernel.org,
	netdev@...r.kernel.org, Petr Mladek <pmladek@...e.com>
Subject: [PATCH] printk: Warn about dropped messages also on extended consoles

The commit #6fe29354befe4c ("printk: implement support for extended console
drivers") added an extra buffer to format messages for extended consoles.
We need to put there also the warning about dropped messages, so it appears
on these consoles.

Signed-off-by: Petr Mladek <pmladek@...e.com>
---
 kernel/printk/printk.c | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
index cf8c24203368..77d3d3698283 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -2254,8 +2254,15 @@ again:
 		}
 
 		if (console_seq < log_first_seq) {
-			len = sprintf(text, "** %u printk messages dropped ** ",
-				      (unsigned)(log_first_seq - console_seq));
+			static const char dropped_msg[] =
+				"** %u printk messages dropped ** ";
+			unsigned int dropped_count =
+				(unsigned int)(log_first_seq - console_seq);
+
+			len = sprintf(text, dropped_msg, dropped_count);
+			if (nr_ext_console_drivers)
+				ext_len = sprintf(ext_text, dropped_msg,
+						  dropped_count);
 
 			/* messages are gone, move to first one */
 			console_seq = log_first_seq;
@@ -2290,8 +2297,8 @@ skip:
 		len += msg_print_text(msg, console_prev, false,
 				      text + len, sizeof(text) - len);
 		if (nr_ext_console_drivers) {
-			ext_len = msg_print_ext_header(ext_text,
-						sizeof(ext_text),
+			ext_len += msg_print_ext_header(ext_text + ext_len,
+						sizeof(ext_text) - ext_len,
 						msg, console_seq, console_prev);
 			ext_len += msg_print_ext_body(ext_text + ext_len,
 						sizeof(ext_text) - ext_len,
-- 
1.8.5.6

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ