diff options
author | Baoquan He <[email protected]> | 2014-10-09 15:25:56 -0700 |
---|---|---|
committer | Linus Torvalds <[email protected]> | 2014-10-09 22:25:50 -0400 |
commit | bf3e2692468fe46eed57d18b3dd1af5b30049122 (patch) | |
tree | b376556f8a86c27066a849e469a940c2a6d764d0 | |
parent | 58cb65487e92b47448d00a711c9f5922137d5678 (diff) |
fs/proc/kcore.c: don't add modules range to kcore if it's equal to vmcore range
On some ARCHs modules range is eauql to vmalloc range. E.g on i686
"#define MODULES_VADDR VMALLOC_START"
"#define MODULES_END VMALLOC_END"
This will cause 2 duplicate program segments in /proc/kcore, and no flag
to indicate they are different. This is confusing. And usually people
who need check the elf header or read the content of kcore will check
memory ranges. Two program segments which are the same are unnecessary.
So check if the modules range is equal to vmalloc range. If so, just skip
adding the modules range.
[[email protected]: coding-style fixes]
Signed-off-by: Baoquan He <[email protected]>
Cc: Xishi Qiu <[email protected]>
Cc: Paul Gortmaker <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
-rw-r--r-- | fs/proc/kcore.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/proc/kcore.c b/fs/proc/kcore.c index 6df8d0722c97..91a4e6426321 100644 --- a/fs/proc/kcore.c +++ b/fs/proc/kcore.c @@ -610,8 +610,10 @@ static void __init proc_kcore_text_init(void) struct kcore_list kcore_modules; static void __init add_modules_range(void) { - kclist_add(&kcore_modules, (void *)MODULES_VADDR, + if (MODULES_VADDR != VMALLOC_START && MODULES_END != VMALLOC_END) { + kclist_add(&kcore_modules, (void *)MODULES_VADDR, MODULES_END - MODULES_VADDR, KCORE_VMALLOC); + } } #else static void __init add_modules_range(void) |