Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a6f5aa1e authored by Catalin Marinas's avatar Catalin Marinas
Browse files

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: default avatarZdenek Kabelac <zdenek.kabelac@gmail.com>
Acked-by: default avatarRusty Russell <rusty@rustcorp.com.au>
Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
parent c017b4be
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -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 */