mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] ensure NULL deref can't possibly happen in is_exported()
@ 2006-05-07 17:23 Jesper Juhl
  0 siblings, 0 replies; only message in thread
From: Jesper Juhl @ 2006-05-07 17:23 UTC (permalink / raw)
  To: linux-kernel
  Cc: Richard Henderson, Richard Henderson, Rusty Russell,
	Andrew Morton, Jesper Juhl


If CONFIG_KALLSYMS is defined and if it should happen that is_exported() 
is given a NULL 'mod' and 
lookup_symbol(name, __start___ksymtab, __stop___ksymtab) returns 0, then 
we'll end up dereferencing a NULL pointer.

Patch below makes sure that'll never happen.


Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
---

 kernel/module.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

--- linux-2.6.17-rc3-git12-orig/kernel/module.c	2006-05-07 03:25:38.000000000 +0200
+++ linux-2.6.17-rc3-git12/kernel/module.c	2006-05-07 19:16:38.000000000 +0200
@@ -1326,7 +1326,7 @@ int is_exported(const char *name, const 
 	if (!mod && lookup_symbol(name, __start___ksymtab, __stop___ksymtab))
 		return 1;
 	else
-		if (lookup_symbol(name, mod->syms, mod->syms + mod->num_syms))
+		if (mod && lookup_symbol(name, mod->syms, mod->syms + mod->num_syms))
 			return 1;
 		else
 			return 0;



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-05-07 17:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-05-07 17:23 [PATCH] ensure NULL deref can't possibly happen in is_exported() Jesper Juhl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome