lkml.org 
[lkml]   [2011]   [Dec]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 1/1] kmemleak/module: only scan the existed data section
Date
We should only scan the sections containing data and it's size is not
zero as well.

Signed-off-by: Tiejun Chen <tiejun.chen@windriver.com>
---
kernel/module.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/kernel/module.c b/kernel/module.c
index 12cfa2b..0b93c30 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -2045,6 +2045,8 @@ static void kmemleak_load_module(struct module *mod, Elf_Ehdr *hdr,
if (strncmp(secstrings + sechdrs[i].sh_name, ".data", 5) != 0
&& strncmp(secstrings + sechdrs[i].sh_name, ".bss", 4) != 0)
continue;
+ if (sechdrs[i].sh_size == 0)
+ continue;

kmemleak_scan_area((void *)sechdrs[i].sh_addr,
sechdrs[i].sh_size, GFP_KERNEL);
--
1.6.0.4


\
 
 \ /
  Last update: 2011-12-28 09:15    [W:0.052 / U:0.084 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site