diff options
| author | Paul Mundt <lethal@linux-sh.org> | 2009-12-24 09:16:02 +0300 | 
|---|---|---|
| committer | Paul Mundt <lethal@linux-sh.org> | 2009-12-24 09:16:02 +0300 | 
| commit | f34548cb735b7a80bbbb0bdd09ad4c2173ba92d5 (patch) | |
| tree | e53c9e39b3149221779c10595bc59fa02de4f45f /kernel/module.c | |
| parent | 76382b5bdb77c29ab430e1b82ef1c604c8dd113b (diff) | |
| parent | 32b53076c31ce9159740b744d5eb5d9505312add (diff) | |
| download | linux-f34548cb735b7a80bbbb0bdd09ad4c2173ba92d5.tar.xz | |
Merge branch 'sh/g3-prep' into sh/for-2.6.33
Diffstat (limited to 'kernel/module.c')
| -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 a65dc787a27b..e96b8ed1cb6a 100644 --- a/kernel/module.c +++ b/kernel/module.c @@ -1910,9 +1910,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)) @@ -1921,8 +1919,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);  	}  } @@ -2250,6 +2247,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 */  | 
