[parisc-linux] [PATCH] fix possible null ptr deref in kallsyms_lookup

Kyle McMartin kyle at parisc-linux.org
Wed May 30 00:43:16 MDT 2007


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 <kyle at parisc-linux.org>

---

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



More information about the parisc-linux mailing list