mirror of
https://github.com/rd-stuffs/msm-4.14.git
synced 2025-02-20 11:45:48 +08:00
mm: nommu: check the vma list when unmapping file-mapped vma
Now we have the sorted vma list, use it in do_munmap() to check that we have an exact match. Signed-off-by: Namhyung Kim <namhyung@gmail.com> Acked-by: Greg Ungerer <gerg@uclinux.org> Cc: David Howells <dhowells@redhat.com> Cc: Paul Mundt <lethal@linux-sh.org> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
e922c4c536
commit
d75a310c42
@ -1635,7 +1635,6 @@ static int shrink_vma(struct mm_struct *mm,
|
|||||||
int do_munmap(struct mm_struct *mm, unsigned long start, size_t len)
|
int do_munmap(struct mm_struct *mm, unsigned long start, size_t len)
|
||||||
{
|
{
|
||||||
struct vm_area_struct *vma;
|
struct vm_area_struct *vma;
|
||||||
struct rb_node *rb;
|
|
||||||
unsigned long end = start + len;
|
unsigned long end = start + len;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
@ -1668,9 +1667,8 @@ int do_munmap(struct mm_struct *mm, unsigned long start, size_t len)
|
|||||||
}
|
}
|
||||||
if (end == vma->vm_end)
|
if (end == vma->vm_end)
|
||||||
goto erase_whole_vma;
|
goto erase_whole_vma;
|
||||||
rb = rb_next(&vma->vm_rb);
|
vma = vma->vm_next;
|
||||||
vma = rb_entry(rb, struct vm_area_struct, vm_rb);
|
} while (vma);
|
||||||
} while (rb);
|
|
||||||
kleave(" = -EINVAL [split file]");
|
kleave(" = -EINVAL [split file]");
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user