Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1cf38741 authored by Juergen Gross's avatar Juergen Gross Committed by David Vrabel
Browse files

x86/xen: fix upper bound of pmd loop in xen_cleanhighmap()



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: default avatarLinus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: default avatarJuergen Gross <jgross@suse.com>
Signed-off-by: default avatarDavid Vrabel <david.vrabel@citrix.com>
parent 842775f1
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -1113,7 +1113,7 @@ static void __init xen_cleanhighmap(unsigned long vaddr,


	/* NOTE: The loop is more greedy than the cleanup_highmap variant.
	/* NOTE: The loop is more greedy than the cleanup_highmap variant.
	 * We include the PMD passed in on _both_ boundaries. */
	 * 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) {
			pmd++, vaddr += PMD_SIZE) {
		if (pmd_none(*pmd))
		if (pmd_none(*pmd))
			continue;
			continue;