mirror of
https://github.com/adulau/aha.git
synced 2024-12-29 12:16:20 +00:00
[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>
This commit is contained in:
parent
5474c120aa
commit
f867d2a2e5
1 changed files with 1 additions and 1 deletions
|
@ -1326,7 +1326,7 @@ int is_exported(const char *name, const struct module *mod)
|
||||||
if (!mod && lookup_symbol(name, __start___ksymtab, __stop___ksymtab))
|
if (!mod && lookup_symbol(name, __start___ksymtab, __stop___ksymtab))
|
||||||
return 1;
|
return 1;
|
||||||
else
|
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;
|
return 1;
|
||||||
else
|
else
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in a new issue