[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1486322486-8024-15-git-send-email-w@1wt.eu>
Date: Sun, 5 Feb 2017 20:20:31 +0100
From: Willy Tarreau <w@....eu>
To: linux-kernel@...r.kernel.org, stable@...r.kernel.org,
linux@...ck-us.net
Cc: Juergen Gross <jgross@...e.com>,
David Vrabel <david.vrabel@...rix.com>,
Willy Tarreau <w@....eu>
Subject: [PATCH 3.10 044/319] x86/xen: fix upper bound of pmd loop in xen_cleanhighmap()
From: Juergen Gross <jgross@...e.com>
commit 1cf38741308c64d08553602b3374fb39224eeb5a upstream.
xen_cleanhighmap() is operating on level2_kernel_pgt only. The upper
bound of the loop setting non-kernel-image entries to zero should not
exceed the size of level2_kernel_pgt.
Reported-by: Linus Torvalds <torvalds@...ux-foundation.org>
Signed-off-by: Juergen Gross <jgross@...e.com>
Signed-off-by: David Vrabel <david.vrabel@...rix.com>
Signed-off-by: Willy Tarreau <w@....eu>
---
arch/x86/xen/mmu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c
index fdc3ba2..53b061c 100644
--- a/arch/x86/xen/mmu.c
+++ b/arch/x86/xen/mmu.c
@@ -1187,7 +1187,7 @@ static void __init xen_cleanhighmap(unsigned long vaddr,
/* NOTE: The loop is more greedy than the cleanup_highmap variant.
* We include the PMD passed in on _both_ boundaries. */
- for (; vaddr <= vaddr_end && (pmd < (level2_kernel_pgt + PAGE_SIZE));
+ for (; vaddr <= vaddr_end && (pmd < (level2_kernel_pgt + PTRS_PER_PMD));
pmd++, vaddr += PMD_SIZE) {
if (pmd_none(*pmd))
continue;
--
2.8.0.rc2.1.gbe9624a
Powered by blists - more mailing lists