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:	Mon,  8 Oct 2012 21:39:17 -0700
From:	Yinghai Lu <yinghai@...nel.org>
To:	Thomas Gleixner <tglx@...utronix.de>, Ingo Molnar <mingo@...e.hu>,
	"H. Peter Anvin" <hpa@...or.com>, Jacob Shin <jacob.shin@....com>,
	Tejun Heo <tj@...nel.org>
Cc:	Stefano Stabellini <stefano.stabellini@...citrix.com>,
	linux-kernel@...r.kernel.org, Yinghai Lu <yinghai@...nel.org>,
	Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>,
	Jeremy Fitzhardinge <jeremy@...p.org>
Subject: [PATCH 09/10] x86, mm: Hide pgt_buf_* into internal to xen

only should be used by init.c and init_64.c and init_32.c

Signed-off-by: Yinghai Lu <yinghai@...nel.org>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>
Cc: Jeremy Fitzhardinge <jeremy@...p.org>
---
 arch/x86/include/asm/init.h |    2 ++
 arch/x86/mm/init.c          |    5 +++++
 arch/x86/xen/mmu.c          |    2 +-
 3 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/arch/x86/include/asm/init.h b/arch/x86/include/asm/init.h
index 4f13998..b69e537 100644
--- a/arch/x86/include/asm/init.h
+++ b/arch/x86/include/asm/init.h
@@ -16,4 +16,6 @@ extern unsigned long __initdata pgt_buf_start;
 extern unsigned long __meminitdata pgt_buf_end;
 extern unsigned long __meminitdata pgt_buf_top;
 
+bool is_pfn_in_early_pgt_buf(unsigned long pfn);
+
 #endif /* _ASM_X86_INIT_32_H */
diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c
index 6622d35..1becfbd 100644
--- a/arch/x86/mm/init.c
+++ b/arch/x86/mm/init.c
@@ -21,6 +21,11 @@ unsigned long __initdata pgt_buf_start;
 unsigned long __meminitdata pgt_buf_end;
 unsigned long __meminitdata pgt_buf_top;
 
+bool __init is_pfn_in_early_pgt_buf(unsigned long pfn)
+{
+	return pfn >= pgt_buf_start && pfn < pgt_buf_top;
+}
+
 int after_bootmem;
 
 int direct_gbpages
diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c
index 7607a33..25f68bc 100644
--- a/arch/x86/xen/mmu.c
+++ b/arch/x86/xen/mmu.c
@@ -1410,7 +1410,7 @@ static pte_t __init mask_rw_pte(pte_t *ptep, pte_t pte)
 	 * If the new pfn is within the range of the newly allocated
 	 * kernel pagetable, make sure it is RO.
 	 */
-	if (pfn >= pgt_buf_start && pfn < pgt_buf_top)
+	if (is_pfn_in_early_pgt_buf(pfn))
 		pte = pte_wrprotect(pte);
 
 	return pte;
-- 
1.7.7

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