public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] module: Add section ".ref.data" into kmemleak-scan-area.
@ 2013-05-11  2:16 majianpeng
  2013-05-13  2:24 ` Rusty Russell
  0 siblings, 1 reply; 5+ messages in thread
From: majianpeng @ 2013-05-11  2:16 UTC (permalink / raw)
  To: rusty; +Cc: lizefan, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1021 bytes --]

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


[-- Attachment #2: 0001-module-Add-section-.ref.data-to-kmemleak-area.patch --]
[-- Type: text/x-patch, Size: 1123 bytes --]

>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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] module: Add section ".ref.data" into kmemleak-scan-area.
  2013-05-11  2:16 [PATCH] module: Add section ".ref.data" into kmemleak-scan-area majianpeng
@ 2013-05-13  2:24 ` Rusty Russell
  2013-05-13 16:42   ` Catalin Marinas
  2013-05-14 21:34   ` Catalin Marinas
  0 siblings, 2 replies; 5+ messages in thread
From: Rusty Russell @ 2013-05-13  2:24 UTC (permalink / raw)
  To: majianpeng; +Cc: lizefan, linux-kernel, Catalin Marinas

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] module: Add section ".ref.data" into kmemleak-scan-area.
  2013-05-13  2:24 ` Rusty Russell
@ 2013-05-13 16:42   ` Catalin Marinas
  2013-05-15  4:55     ` Rusty Russell
  2013-05-14 21:34   ` Catalin Marinas
  1 sibling, 1 reply; 5+ messages in thread
From: Catalin Marinas @ 2013-05-13 16:42 UTC (permalink / raw)
  To: Rusty Russell; +Cc: majianpeng, lizefan@huawei.com, linux-kernel

On Mon, May 13, 2013 at 03:24:09AM +0100, Rusty Russell wrote:
> 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>

Looks good, thanks for cc'ing me.

Acked-by: Catalin Marinas <catalin.marinas@arm.com>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] module: Add section ".ref.data" into kmemleak-scan-area.
  2013-05-13  2:24 ` Rusty Russell
  2013-05-13 16:42   ` Catalin Marinas
@ 2013-05-14 21:34   ` Catalin Marinas
  1 sibling, 0 replies; 5+ messages in thread
From: Catalin Marinas @ 2013-05-14 21:34 UTC (permalink / raw)
  To: Rusty Russell; +Cc: majianpeng, lizefan@huawei.com, linux-kernel

Rusty,

On Mon, May 13, 2013 at 03:24:09AM +0100, Rusty Russell wrote:
> 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>

I forgot to ask - are you picking up this patch or would like me to push
upstream? The patch got some more testing on a separate thread:

Tested-by: Steven Rostedt <rostedt@goodmis.org>

Thanks.

-- 
Catalin

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] module: Add section ".ref.data" into kmemleak-scan-area.
  2013-05-13 16:42   ` Catalin Marinas
@ 2013-05-15  4:55     ` Rusty Russell
  0 siblings, 0 replies; 5+ messages in thread
From: Rusty Russell @ 2013-05-15  4:55 UTC (permalink / raw)
  To: Catalin Marinas
  Cc: majianpeng, lizefan@huawei.com, linux-kernel, Steven Rostedt,
	Linus Torvalds

Catalin Marinas <catalin.marinas@arm.com> writes:
> On Mon, May 13, 2013 at 03:24:09AM +0100, Rusty Russell wrote:
>> 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>
>
> Looks good, thanks for cc'ing me.
>
> Acked-by: Catalin Marinas <catalin.marinas@arm.com>

I use "Acked-by" to mean "it touches my code so normally it'd go in my
tree, but it's not".

Since you replied the same, I defer to your wishes and put it in my
fixes branch (or Linus will grab it now).  I also removed the extra
trailing space ('git am' complained).

Thanks,
Rusty.

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>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Tested-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

diff --git a/kernel/module.c b/kernel/module.c
index b049939..e4ee1bf 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,

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-05-15  5:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-11  2:16 [PATCH] module: Add section ".ref.data" into kmemleak-scan-area majianpeng
2013-05-13  2:24 ` Rusty Russell
2013-05-13 16:42   ` Catalin Marinas
2013-05-15  4:55     ` Rusty Russell
2013-05-14 21:34   ` Catalin Marinas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox