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: <20170609135743.9920-1-vbabka@suse.cz>
Date:   Fri,  9 Jun 2017 15:57:43 +0200
From:   Vlastimil Babka <vbabka@...e.cz>
To:     Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>,
        "H . Peter Anvin" <hpa@...or.com>
Cc:     x86@...nel.org, linux-mm@...ck.org, linux-kernel@...r.kernel.org,
        Vegard Nossum <vegardno@....uio.no>,
        Pekka Enberg <penberg@...nel.org>,
        Christian Borntraeger <borntraeger@...ibm.com>,
        Vlastimil Babka <vbabka@...e.cz>
Subject: [PATCH] x86, mm: disable 1GB direct mapping when disabling 2MB mapping

The kmemleak and debug_pagealloc features both disable using huge pages for
direct mapping so they can do cpa() on page level granularity in any context.
However they only do that for 2MB pages, which means 1GB pages can still be
used if the CPU supports it, unless disabled by a boot param, which is
non-obvious. Disable also 1GB pages when disabling 2MB pages.

Signed-off-by: Vlastimil Babka <vbabka@...e.cz>
---
 arch/x86/mm/init.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c
index cbc87ea98751..20282dfce0fa 100644
--- a/arch/x86/mm/init.c
+++ b/arch/x86/mm/init.c
@@ -170,6 +170,10 @@ static void __init probe_page_size_mask(void)
 	 */
 	if (boot_cpu_has(X86_FEATURE_PSE) && !debug_pagealloc_enabled())
 		page_size_mask |= 1 << PG_LEVEL_2M;
+	else
+		direct_gbpages = 0;
+#else
+	direct_gbpages = 0;
 #endif
 
 	/* Enable PSE if available */
-- 
2.13.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ