lkml.org 
[lkml]   [2013]   [May]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] module: Add section ".ref.data" into kmemleak-scan-area.
Date
majianpeng <majianpeng@gmail.com> writes:

> In commit 523c81135,it used "__refdata" on event_class_ftrace_##call.
> It will cause kmemleak to misjudge because when loading module it did
> not add '.ref.data' into kmemleak-scan-area.
>
> Signed-off-by: Jianpeng Ma <majianpeng@gmail.com>
> ---
> kernel/module.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)

Catalin?

Acked-by: Rusty Russell <rusty@rustcorp.com.au>

Cheers,
Rusty.

> diff --git a/kernel/module.c b/kernel/module.c
> index b049939..dafe2ea 100644
> --- a/kernel/module.c
> +++ b/kernel/module.c
> @@ -2434,7 +2434,8 @@ static void kmemleak_load_module(const struct module *mod,
> const char *name = info->secstrings + info->sechdrs[i].sh_name;
> if (!(info->sechdrs[i].sh_flags & SHF_ALLOC))
> continue;
> - if (!strstarts(name, ".data") && !strstarts(name, ".bss"))
> + if (!strstarts(name, ".data") && !strstarts(name, ".bss") &&
> + !strstarts(name, ".ref.data"))
> continue;
>
> kmemleak_scan_area((void *)info->sechdrs[i].sh_addr,
> --
> 1.7.10.4
>
>>From 9adf5b9aae7ceb97828042d0ae8fe9fb688bc691 Mon Sep 17 00:00:00 2001
> From: Jianpeng Ma <majianpeng@gmail.com>
> Date: Sat, 11 May 2013 10:04:14 +0800
> Subject: [PATCH] module: Add section ".ref.data" into kmemleak-scan-area.
>
> In commit 523c81135,it used "__refdata" on event_class_ftrace_##call.
> It will cause kmemleak to misjudge because when loading module it did
> not add '.ref.data' into kmemleak-scan-area.
>
> Signed-off-by: Jianpeng Ma <majianpeng@gmail.com>
> ---
> kernel/module.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/kernel/module.c b/kernel/module.c
> index b049939..dafe2ea 100644
> --- a/kernel/module.c
> +++ b/kernel/module.c
> @@ -2434,7 +2434,8 @@ static void kmemleak_load_module(const struct module *mod,
> const char *name = info->secstrings + info->sechdrs[i].sh_name;
> if (!(info->sechdrs[i].sh_flags & SHF_ALLOC))
> continue;
> - if (!strstarts(name, ".data") && !strstarts(name, ".bss"))
> + if (!strstarts(name, ".data") && !strstarts(name, ".bss") &&
> + !strstarts(name, ".ref.data"))
> continue;
>
> kmemleak_scan_area((void *)info->sechdrs[i].sh_addr,
> --
> 1.7.10.4


\
 
 \ /
  Last update: 2013-05-13 05:41    [W:0.058 / U:1.664 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site