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]
Date:	Sat, 30 Oct 2010 14:08:48 -0700
From:	Joe Perches <joe@...ches.com>
To:	Jiri Kosina <trivial@...nel.org>
Cc:	linux-kernel@...r.kernel.org
Subject: [PATCH 31/39] kernel/panic.c: Update warn_slowpath to use %pV

Replace struct slowpath_args with struct va_format.
Add KERN_WARNING to output.
Remove space after pointer in panic declaration.

Signed-off-by: Joe Perches <joe@...ches.com>
---
 kernel/panic.c |   40 ++++++++++++++++++----------------------
 1 files changed, 18 insertions(+), 22 deletions(-)

diff --git a/kernel/panic.c b/kernel/panic.c
index 4c13b1a..8943c8f 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -56,7 +56,7 @@ EXPORT_SYMBOL(panic_blink);
  *
  *	This function never returns.
  */
-NORET_TYPE void panic(const char * fmt, ...)
+NORET_TYPE void panic(const char *fmt, ...)
 {
 	static char buf[1024];
 	va_list args;
@@ -357,13 +357,9 @@ void oops_exit(void)
 }
 
 #ifdef WANT_WARN_ON_SLOWPATH
-struct slowpath_args {
-	const char *fmt;
-	va_list args;
-};
 
 static void warn_slowpath_common(const char *file, int line, void *caller,
-				 unsigned taint, struct slowpath_args *args)
+				 unsigned taint, struct va_format *vaf)
 {
 	const char *board;
 
@@ -372,10 +368,8 @@ static void warn_slowpath_common(const char *file, int line, void *caller,
 	board = dmi_get_system_info(DMI_PRODUCT_NAME);
 	if (board)
 		printk(KERN_WARNING "Hardware name: %s\n", board);
-
-	if (args)
-		vprintk(args->fmt, args->args);
-
+	if (vaf)
+		printk(KERN_WARNING "%pV", vaf);
 	print_modules();
 	dump_stack();
 	print_oops_end_marker();
@@ -384,26 +378,28 @@ static void warn_slowpath_common(const char *file, int line, void *caller,
 
 void warn_slowpath_fmt(const char *file, int line, const char *fmt, ...)
 {
-	struct slowpath_args args;
-
-	args.fmt = fmt;
-	va_start(args.args, fmt);
+	struct va_format vaf;
+	va_list va;
+	va_start(va, fmt);
+	vaf.fmt = fmt;
+	vaf.va = &va;
 	warn_slowpath_common(file, line, __builtin_return_address(0),
-			     TAINT_WARN, &args);
-	va_end(args.args);
+			     TAINT_WARN, &vaf);
+	va_end(va);
 }
 EXPORT_SYMBOL(warn_slowpath_fmt);
 
 void warn_slowpath_fmt_taint(const char *file, int line,
 			     unsigned taint, const char *fmt, ...)
 {
-	struct slowpath_args args;
-
-	args.fmt = fmt;
-	va_start(args.args, fmt);
+	struct va_format vaf;
+	va_list va;
+	va_start(va, fmt);
+	vaf.fmt = fmt;
+	vaf.va = &va;
 	warn_slowpath_common(file, line, __builtin_return_address(0),
-			     taint, &args);
-	va_end(args.args);
+			     taint, &vaf);
+	va_end(va);
 }
 EXPORT_SYMBOL(warn_slowpath_fmt_taint);
 
-- 
1.7.3.1.g432b3.dirty

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