Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PATCH] mm: fix remap_pte_range BUG

Out-of-tree user of remap_pfn_range hit kernel BUG at mm/memory.c:1112! It
passes an unrounded size to remap_pfn_range, which was okay before 2.6.12,
but misses remap_pte_range's new end condition. An audit of all the other
ptwalks confirms that this is the only one so exposed.

Signed-off-by: Hugh Dickins <hugh@veritas.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Hugh Dickins and committed by
Linus Torvalds
2d15cab8 1e8a81c5

+1 -1
+1 -1
mm/memory.c
··· 1139 1139 { 1140 1140 pgd_t *pgd; 1141 1141 unsigned long next; 1142 - unsigned long end = addr + size; 1142 + unsigned long end = addr + PAGE_ALIGN(size); 1143 1143 struct mm_struct *mm = vma->vm_mm; 1144 1144 int err; 1145 1145