[PATCH] swap 06/13 wrap below vm_start

From: Hugh Dickins (hugh@veritas.com)
Date: Tue Mar 25 2003 - 17:15:49 EST


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/



This archive was generated by hypermail 2b29 : Mon Mar 31 2003 - 22:00:21 EST