login
Header Space

 
 

[PATCH] x86: traps_32.c - use KSYM_NAME_LEN instead of numeric value

Previous thread: [PATCH 0/5] time/ntp changes by john stultz on Saturday, March 15, 2008 - 12:04 am. (20 messages)

Next thread: [PATCH] Remove superfluous include of string.h from percpu.h. by Robert P. J. Day on Saturday, March 15, 2008 - 5:02 am. (1 message)
To: LKML <linux-kernel@...>
Cc: Ingo Molnar <mingo@...>, Andrew Morton <akpm@...>
Date: Saturday, March 15, 2008 - 4:34 am

It's safer to use KSYM_NAME_LEN instead of numeric constant
because we could get buffer overrun someday if KSYM_NAME_LEN
would be changed to a bigger value.

Signed-off-by: Cyrill Gorcunov &lt;gorcunov@gmail.com&gt;
---

I've patched 64bit version but forgot about 32bit. So
lets fix it too.

Index: linux-2.6.git/arch/x86/kernel/traps_32.c
===================================================================
--- linux-2.6.git.orig/arch/x86/kernel/traps_32.c	2008-02-09 22:27:13.000000000 +0300
+++ linux-2.6.git/arch/x86/kernel/traps_32.c	2008-03-15 11:21:16.000000000 +0300
@@ -109,7 +109,7 @@ void printk_address(unsigned long addres
 	const char *symname;
 	char *modname;
 	char *delim = ":";
-	char namebuf[128];
+	char namebuf[KSYM_NAME_LEN];
 	char reliab[4] = "";
 
 	symname = kallsyms_lookup(address, &amp;symsize, &amp;offset,
--
To: Cyrill Gorcunov <gorcunov@...>
Cc: LKML <linux-kernel@...>, Andrew Morton <akpm@...>
Date: Friday, March 21, 2008 - 7:37 am

thanks, applied.

	Ingo
--
Previous thread: [PATCH 0/5] time/ntp changes by john stultz on Saturday, March 15, 2008 - 12:04 am. (20 messages)

Next thread: [PATCH] Remove superfluous include of string.h from percpu.h. by Robert P. J. Day on Saturday, March 15, 2008 - 5:02 am. (1 message)
speck-geostationary