From 986bd4301425ab01934f8efe08ed9433b45492bb Mon Sep 17 00:00:00 2001 From: Hugh Dickins Date: Wed, 22 Jun 2005 14:02:41 +0100 Subject: [PATCH] [PATCH] 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 Signed-off-by: Chris Wright --- mm/memory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/memory.c b/mm/memory.c index d209f745db7f..2f88f084fea5 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -1164,7 +1164,7 @@ int remap_pfn_range(struct vm_area_struct *vma, unsigned long addr, { pgd_t *pgd; unsigned long next; - unsigned long end = addr + size; + unsigned long end = addr + PAGE_ALIGN(size); struct mm_struct *mm = vma->vm_mm; int err;