summaryrefslogtreecommitdiffstats
path: root/kernel/module.c
diff options
context:
space:
mode:
authorJesper Juhl <jesper.juhl@gmail.com>2006-06-25 14:47:09 +0200
committerLinus Torvalds <torvalds@g5.osdl.org>2006-06-25 19:00:59 +0200
commitf867d2a2e5f3f0ce6356f452cc27b70d577de7c7 (patch)
tree2c098f197a80847510b7f0e98ca2209e89dfd32f /kernel/module.c
parent[PATCH] Rewritten backlight infrastructure for portable Apple computers (diff)
downloadlinux-f867d2a2e5f3f0ce6356f452cc27b70d577de7c7.tar.xz
linux-f867d2a2e5f3f0ce6356f452cc27b70d577de7c7.zip
[PATCH] ensure NULL deref can't possibly happen in is_exported()
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. Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com> Cc: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel/module.c')
-rw-r--r--kernel/module.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/module.c b/kernel/module.c
index bbe04862e1b0..d75275de1c28 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -1326,7 +1326,7 @@ int is_exported(const char *name, const struct module *mod)
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;