From: Kyle McMartin Date: Wed, 30 May 2007 06:43:16 +0000 (-0400) Subject: fix possible null ptr deref in kallsyms_lookup X-Git-Tag: v2.6.22-rc4~86 X-Git-Url: http://ftp.safe.ca/?p=safe%2Fjmp%2Flinux-2.6;a=commitdiff_plain;h=7a74fc4925067c2102175baef73f9b07ab519b71 fix possible null ptr deref in kallsyms_lookup ugh, this function gets called by our unwinder. recursive backtrace for the win... bisection to find this one was "fun." Signed-off-by: Kyle McMartin Signed-off-by: Linus Torvalds --- diff --git a/kernel/kallsyms.c b/kernel/kallsyms.c index f1bda23..fed5441 100644 --- a/kernel/kallsyms.c +++ b/kernel/kallsyms.c @@ -257,7 +257,8 @@ const char *kallsyms_lookup(unsigned long addr, pos = get_symbol_pos(addr, symbolsize, offset); /* Grab name */ kallsyms_expand_symbol(get_symbol_offset(pos), namebuf); - *modname = NULL; + if (modname) + *modname = NULL; return namebuf; }