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-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1254904787-11323-6-git-send-email-alan-jenkins@tuffmail.co.uk>
Date:	Wed,  7 Oct 2009 09:39:45 +0100
From:	Alan Jenkins <alan-jenkins@...fmail.co.uk>
To:	mingo@...hat.com
Cc:	x86@...nel.org, linux-kernel@...r.kernel.org,
	torvalds@...ux-foundation.org,
	Alan Jenkins <alan-jenkins@...fmail.co.uk>
Subject: [PATCH 5/7] printk: fix printk(KERN_EMERG) followed by printk("emergency message\n")

Commit 5fd29d6 "printk: clean up handling of log-levels and newlines"
causes printk(KERN_EMERG) to be ignored. Any "emergency message" which
follows will be printed as KERN_DEFAULT.

This affects arch/x86/dumpstack.c, causing critical crash information to
be logged as KERN_DEFAULT.

Signed-off-by: Alan Jenkins <alan-jenkins@...fmail.co.uk>
---
 kernel/printk.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/kernel/printk.c b/kernel/printk.c
index 1714435..c7a1a85 100644
--- a/kernel/printk.c
+++ b/kernel/printk.c
@@ -763,14 +763,17 @@ asmlinkage int vprintk(const char *fmt, va_list args)
 	}
 
 	/*
-	 * Copy the output into log_buf.  If the caller didn't provide
-	 * appropriate log level tags, we insert them here
+	 * Now copy the output into log_buf.
+	 * We add a log level tag at the start of each new line.
 	 */
+	if (new_text_line) {
+		new_text_line = 0;
+		printk_token(current_log_level);
+	}
+
 	for ( ; *p; p++) {
 		if (new_text_line) {
 			new_text_line = 0;
-
-			/* Always output the token */
 			printk_token(current_log_level);
 		}
 
-- 
1.6.3.2

--
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