diff options
author | Stephen Rothwell <sfr@canb.auug.org.au> | 2009-11-26 17:11:04 +1100 |
---|---|---|
committer | Stephen Rothwell <sfr@canb.auug.org.au> | 2009-11-26 17:11:04 +1100 |
commit | 28453b0dd37121d3ca47b105ff934e7f831c59a9 (patch) | |
tree | 690af118f88674287a46416d66cbd8f887f9a707 /kernel | |
parent | 910c3fbabe6e558702c5c13d4ee3f60459971381 (diff) | |
parent | d6ad05a86bde20cdb4efbccc6ea9b24edf001886 (diff) |
Merge remote branch 'catalin/for-next'
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/module.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/kernel/module.c b/kernel/module.c index 29432fd20340..d7e76428438e 100644 --- a/kernel/module.c +++ b/kernel/module.c @@ -2080,9 +2080,7 @@ static void kmemleak_load_module(struct module *mod, Elf_Ehdr *hdr, unsigned int i; /* only scan the sections containing data */ - kmemleak_scan_area(mod->module_core, (unsigned long)mod - - (unsigned long)mod->module_core, - sizeof(struct module), GFP_KERNEL); + kmemleak_scan_area(mod, sizeof(struct module), GFP_KERNEL); for (i = 1; i < hdr->e_shnum; i++) { if (!(sechdrs[i].sh_flags & SHF_ALLOC)) @@ -2091,8 +2089,7 @@ static void kmemleak_load_module(struct module *mod, Elf_Ehdr *hdr, && strncmp(secstrings + sechdrs[i].sh_name, ".bss", 4) != 0) continue; - kmemleak_scan_area(mod->module_core, sechdrs[i].sh_addr - - (unsigned long)mod->module_core, + kmemleak_scan_area((void *)sechdrs[i].sh_addr, sechdrs[i].sh_size, GFP_KERNEL); } } @@ -2418,6 +2415,12 @@ static noinline struct module *load_module(void __user *umod, "_ftrace_events", sizeof(*mod->trace_events), &mod->num_trace_events); + /* + * This section contains pointers to allocated objects in the trace + * code and not scanning it leads to false positives. + */ + kmemleak_scan_area(mod->trace_events, sizeof(*mod->trace_events) * + mod->num_trace_events, GFP_KERNEL); #endif #ifdef CONFIG_FTRACE_MCOUNT_RECORD /* sechdrs[0].sh_size is always zero */ |