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:	Tue, 30 Sep 2008 10:38:50 -0500
From:	Christoph Lameter <cl@...ux-foundation.org>
To:	Richard Kennedy <richard@....demon.co.uk>
CC:	penberg <penberg@...helsinki.fi>, mpm <mpm@...enic.com>,
	linux-mm <linux-mm@...ck.org>,
	lkml <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] slub: reduce total stack usage of slab_err & object_err

Richard Kennedy wrote:
> reduce the total stack usage of slab_err & object_err.
> 
> Introduce a new function to display a simple slab bug message, and call
> this when vprintk is not needed.

You could simply get rid of the 100 byte buffer by using vprintk? Same method
could be used elsewhere in the kernel and does not require additional
functions. Compiles, untestted.




Subject: Slub reduce slab_bug stack usage by using vprintk

Signed-off-by: Christoph Lameter <cl@...ux-foundation.org>

Index: linux-2.6/mm/slub.c
===================================================================
--- linux-2.6.orig/mm/slub.c	2008-09-30 10:34:40.000000000 -0500
+++ linux-2.6/mm/slub.c	2008-09-30 10:36:10.000000000 -0500
@@ -422,15 +422,14 @@
 static void slab_bug(struct kmem_cache *s, char *fmt, ...)
 {
 	va_list args;
-	char buf[100];

 	va_start(args, fmt);
-	vsnprintf(buf, sizeof(buf), fmt, args);
-	va_end(args);
 	printk(KERN_ERR "========================================"
 			"=====================================\n");
-	printk(KERN_ERR "BUG %s: %s\n", s->name, buf);
-	printk(KERN_ERR "----------------------------------------"
+	printk(KERN_ERR "BUG %s: ", s->name);
+	vprintk(fmt, args);
+	va_end(args);
+	printk(KERN_ERR "\n----------------------------------------"
 			"-------------------------------------\n\n");
 }

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