Skip to content

Commit

Permalink
x86/xen: fix upper bound of pmd loop in xen_cleanhighmap()
Browse files Browse the repository at this point in the history
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@linux-foundation.org>
Signed-off-by: Juergen Gross <jgross@suse.com>
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
  • Loading branch information
jgross1 authored and David Vrabel committed Jun 23, 2016
1 parent 842775f commit 1cf3874
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/x86/xen/mmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1113,7 +1113,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;
Expand Down

0 comments on commit 1cf3874

Please sign in to comment.