diff options
author | KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> | 2011-07-25 20:12:09 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-07-25 23:57:08 -0400 |
commit | 4b6ddbf7ed4ef2f40e0a27418146eedaa68953c6 (patch) | |
tree | 27ab200848514a467f656281073b9c0f86cb7dcc /mm/pagewalk.c | |
parent | 45ebb840257b060ec54416aebffd9747e210962c (diff) |
pagewalk: fix walk_page_range() don't check find_vma() result properly
The doc of find_vma() says,
/* Look up the first VMA which satisfies addr < vm_end, NULL if none. */
struct vm_area_struct *find_vma(struct mm_struct *mm, unsigned long addr)
{
(snip)
Thus, caller should confirm whether the returned vma matches a desired one.
Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Cc: Hiroyuki Kamezawa <kamezawa.hiroyuki@gmail.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: Matt Mackall <mpm@selenic.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/pagewalk.c')
-rw-r--r-- | mm/pagewalk.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/pagewalk.c b/mm/pagewalk.c index c3450d533611..606bbb4125d0 100644 --- a/mm/pagewalk.c +++ b/mm/pagewalk.c | |||
@@ -176,7 +176,7 @@ int walk_page_range(unsigned long addr, unsigned long end, | |||
176 | * we can't handled it in the same manner as non-huge pages. | 176 | * we can't handled it in the same manner as non-huge pages. |
177 | */ | 177 | */ |
178 | vma = find_vma(walk->mm, addr); | 178 | vma = find_vma(walk->mm, addr); |
179 | if (vma && is_vm_hugetlb_page(vma)) { | 179 | if (vma && vma->vm_start <= addr && is_vm_hugetlb_page(vma)) { |
180 | if (vma->vm_end < next) | 180 | if (vma->vm_end < next) |
181 | next = vma->vm_end; | 181 | next = vma->vm_end; |
182 | /* | 182 | /* |