summaryrefslogtreecommitdiffstats
path: root/kernel/module.c
diff options
context:
space:
mode:
authorCatalin Marinas2009-10-28 14:33:10 +0100
committerCatalin Marinas2009-10-28 18:07:54 +0100
commita6f5aa1ea05686ad6e84593a00a04161e6dfb3a3 (patch)
tree4521e6f84911fc29d667314d8950be54342584d7 /kernel/module.c
parentkmemleak: Simplify the kmemleak_scan_area() function prototype (diff)
downloadkernel-qcow2-linux-a6f5aa1ea05686ad6e84593a00a04161e6dfb3a3.tar.gz
kernel-qcow2-linux-a6f5aa1ea05686ad6e84593a00a04161e6dfb3a3.tar.xz
kernel-qcow2-linux-a6f5aa1ea05686ad6e84593a00a04161e6dfb3a3.zip
kmemleak: Scan the _ftrace_events section in modules
This section contains pointers to allocated objects and not scanning it leads to false positives. Reported-by: Zdenek Kabelac <zdenek.kabelac@gmail.com> Acked-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Diffstat (limited to 'kernel/module.c')
-rw-r--r--kernel/module.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/kernel/module.c b/kernel/module.c
index 1eb952097077..dd29ba43c34f 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -2380,6 +2380,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 */