lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1409099634-24899-1-git-send-email-bhe@redhat.com>
Date:	Wed, 27 Aug 2014 08:33:54 +0800
From:	Baoquan He <bhe@...hat.com>
To:	linux-kernel@...r.kernel.org, akpm@...ux-foundation.org
Cc:	qiuxishi@...wei.com, paul.gortmaker@...driver.com,
	Baoquan He <bhe@...hat.com>
Subject: [PATCH v4] not adding 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
any flag to indicate both of them 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 completely are unnecessary.

So in this patch a judgment added to check if modules range is equal
to vmalloc range completely. If yes, just skip adding the modules
range.

Signed-off-by: Baoquan He <bhe@...hat.com>
---
 fs/proc/kcore.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/fs/proc/kcore.c b/fs/proc/kcore.c
index 6df8d07..69cb67b 100644
--- a/fs/proc/kcore.c
+++ b/fs/proc/kcore.c
@@ -610,8 +610,11 @@ 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)
-- 
1.9.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ