[PATCH] swap 06/13 wrap below vm_start

Hugh Dickins (hugh@veritas.com)
Tue, 25 Mar 2003 22:15:49 +0000 (GMT)


objrmap must check lest address wrapped below vma->vm_start.

--- swap05/mm/rmap.c Tue Mar 25 20:43:40 2003
+++ swap06/mm/rmap.c Tue Mar 25 20:43:51 2003
@@ -100,12 +100,8 @@
unsigned long address;

loffset = (page->index << (PAGE_CACHE_SHIFT - PAGE_SHIFT));
- if (loffset < vma->vm_pgoff)
- goto out;
-
address = vma->vm_start + ((loffset - vma->vm_pgoff) << PAGE_SHIFT);
-
- if (address >= vma->vm_end)
+ if (address < vma->vm_start || address >= vma->vm_end)
goto out;

pgd = pgd_offset(mm, address);

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/