Skip to contentSkip to conversation

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

PATCH Applied Cyrill Gorcunov 2 participants 2 messages Mar 15, 2008 – Mar 21, 2008 x86

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86: traps_32.c - use KSYM_NAME_LEN instead of numeric value

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.

---

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

arch/x86/kernel/traps_32.c +1 -1
Index: linux-2.6.git/arch/x86/kernel/traps_32.c
===================================================================
@@ -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, &symsize, &offset,
Applied
#1 lore raw
Quoted 3 lines · Cyrill Gorcunov

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.

thanks, applied.

Ingo