Skip to contentSkip to conversation

module: Add section ".ref.data" into kmemleak-scan-area.

PATCH In review majianpeng 3 participants 5 messages May 11, 2013 – May 15, 2013

lore
Share & tools
lore

majianpeng

author
#0 lore raw

PATCH 1/1 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.

---
 kernel/module.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
kernel/module.c +2 -1
index b049939..dafe2ea 100644
@@ -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,
Signature · 1 line
1.7.10.4
Quoted 1 line

From 9adf5b9aae7ceb97828042d0ae8fe9fb688bc691 Mon Sep 17 00:00:00 2001

From: Jianpeng Ma <[email protected]>
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.

---
 kernel/module.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
kernel/module.c +2 -1
index b049939..dafe2ea 100644
@@ -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,
Signature · 1 line
1.7.10.4
Acked-by on v1 1/1
#1 lore raw
Quoted 8 lines · majianpeng

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.

---
 kernel/module.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Catalin?

Cheers,
Rusty.

Quoted 47 lines
kernel/module.c +2 -1
index b049939..dafe2ea 100644
@@ -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,
Signature · 1 line
1.7.10.4
Quoted 1 line

From 9adf5b9aae7ceb97828042d0ae8fe9fb688bc691 Mon Sep 17 00:00:00 2001

From: Jianpeng Ma <[email protected]>
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.

---
 kernel/module.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
kernel/module.c +2 -1
index b049939..dafe2ea 100644
@@ -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,
Signature · 1 line
1.7.10.4
#2 lore raw
Quoted 6 lines · Rusty Russell
Quoted 4 lines · majianpeng

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.

Quoted 8 lines
Quoted 4 lines
---
 kernel/module.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Catalin?

Looks good, thanks for cc'ing me.

Acked-by Catalin Marinas Tested-by Steven Rostedt
#3 lore raw
Quoted 12 lines · Catalin Marinas
Quoted 11 lines · Rusty Russell
Quoted 8 lines · majianpeng

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.

---
 kernel/module.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Quoted 7 lines
Quoted 3 lines

Catalin?

Looks good, thanks for cc'ing me.

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 <[email protected]>
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.

kernel/module.c +2 -1
index b049939..e4ee1bf 100644
@@ -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,
Tested-by Steven Rostedt
#4 lore raw
In reply to Rusty Russell

Rusty,

Quoted 6 lines · Rusty Russell
Quoted 4 lines · majianpeng

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.

Quoted 8 lines
Quoted 4 lines
---
 kernel/module.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Catalin?

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:

Thanks.

Signature · 1 line
Catalin