[PATCH] fix possible null ptr deref in kallsyms_lookup
Kyle McMartin <[email protected]>
| Newsgroups | gmane.linux.ports.hppa |
|---|---|
| Message-ID | <[email protected]> |
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 <[email protected]> --- commit ffb45122766db220d0bf3d01848d575fbbcb6430 removed our modname arg since it was otherwise unused, but i was not cc'd on the patch :/ 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; }