瀏覽代碼

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 <kyle@parisc-linux.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Kyle McMartin 18 年之前
父節點
當前提交
7a74fc4925
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      kernel/kallsyms.c

+ 2 - 1
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;
 	}