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>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu,  2 Jan 2014 13:53:29 -0800
From:	Laura Abbott <lauraa@...eaurora.org>
To:	Andrew Morton <akpm@...ux-foundation.org>,
	Kyungmin Park <kmpark@...radead.org>,
	Dave Hansen <dave@...1.net>, linux-mm@...ck.org
Cc:	linux-kernel@...r.kernel.org, Laura Abbott <lauraa@...eaurora.org>
Subject: [RFC PATCHv3 11/11] fs/proc/kcore.c: Use for_each_potential_vmalloc_area

With CONFIG_INTERMIX_VMALLOC, we can no longer assume all vmalloc
is contained between VMALLOC_START and VMALLOC_END. For code that
relies on operating on the vmalloc space, use
for_each_potential_vmalloc_area to track each area separately.

Signed-off-by: Laura Abbott <lauraa@...eaurora.org>
---
 fs/proc/kcore.c |   20 +++++++++++++++-----
 1 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/fs/proc/kcore.c b/fs/proc/kcore.c
index 5ed0e52..9be81a8 100644
--- a/fs/proc/kcore.c
+++ b/fs/proc/kcore.c
@@ -585,8 +585,6 @@ static struct notifier_block kcore_callback_nb __meminitdata = {
 	.priority = 0,
 };
 
-static struct kcore_list kcore_vmalloc;
-
 #ifdef CONFIG_ARCH_PROC_KCORE_TEXT
 static struct kcore_list kcore_text;
 /*
@@ -621,6 +619,11 @@ static void __init add_modules_range(void)
 
 static int __init proc_kcore_init(void)
 {
+	struct kcore_list *kcore_vmalloc;
+	unsigned long vstart;
+	unsigned long vend;
+	int i;
+
 	proc_root_kcore = proc_create("kcore", S_IRUSR, NULL,
 				      &proc_kcore_operations);
 	if (!proc_root_kcore) {
@@ -629,9 +632,16 @@ static int __init proc_kcore_init(void)
 	}
 	/* Store text area if it's special */
 	proc_kcore_text_init();
-	/* Store vmalloc area */
-	kclist_add(&kcore_vmalloc, (void *)VMALLOC_START,
-		VMALLOC_END - VMALLOC_START, KCORE_VMALLOC);
+	for_each_potential_vmalloc_area(&vstart, &vend, &i) {
+		kcore_vmalloc = kzalloc(sizeof(*kcore_vmalloc), GFP_KERNEL);
+		if (!kcore_vmalloc)
+			return 0;
+
+		/* Store vmalloc area */
+		kclist_add(kcore_vmalloc, (void *)vstart,
+				vend - vstart, KCORE_VMALLOC);
+	}
+
 	add_modules_range();
 	/* Store direct-map area from physical memory map */
 	kcore_update_ram();
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation

--
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