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-next>] [day] [month] [year] [list]
Message-ID: <20160111170428.GA8547@codemonkey.org.uk>
Date:	Mon, 11 Jan 2016 12:04:28 -0500
From:	Dave Jones <davej@...emonkey.org.uk>
To:	x86@...nel.org
Cc:	Linux Kernel <linux-kernel@...r.kernel.org>
Subject: [x86] Make split_page_count check for empty levels.

In PAGEALLOC_DEBUG builds, we disable the 2M pages.
Unfortunatly when we split up mappings during boot,
split_page_count doesn't take this into account, and
starts decrementing an empty direct_pages_count level.

This results in /proc/meminfo showing crazy things like
DirectMap2M:    18446744073709543424 kB

Signed-off-by: Dave Jones <davej@...emonkey.org.uk>

diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c
index a3137a4feed1..ff0e0c6c350e 100644
--- a/arch/x86/mm/pageattr.c
+++ b/arch/x86/mm/pageattr.c
@@ -66,6 +66,9 @@ void update_page_count(int level, unsigned long pages)
 
 static void split_page_count(int level)
 {
+	if (direct_pages_count[level] == 0)
+		return;
+
 	direct_pages_count[level]--;
 	direct_pages_count[level - 1] += PTRS_PER_PTE;
 }

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ