nommu: get_user_pages(): pin last page on non-page-aligned start
Subsystems (2)
PATCH 1/1 nommu: get_user_pages(): pin last page on non-page-aligned start
The noMMU version of get_user_pages() fails to pin the last page when the start address isn't page-aligned. The patch fixes this in a way that makes find_extend_vma() congruent to its MMU cousin.
---
mm/nommu.c +2 -2
@@ -146,7 +146,7 @@ int __get_user_pages(struct task_struct (VM_MAYREAD | VM_MAYWRITE) : (VM_READ | VM_WRITE);for (i =0 ; i < nr_pages; i++) { - vma =find_vma (mm, start); + vma =find_extend_vma (mm, start);if (!vma) goto finish_or_fault;
@@ -764,7 +764,7 @@ EXPORT_SYMBOL(find_vma);*/ struct vm_area_struct *find_extend_vma (struct mm_struct *mm,unsigned long addr) { -return find_vma (mm, addr); +return find_vma (mm, addr &PAGE_MASK ); }/*
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 5 lines · Steven J. Magnani
The noMMU version of
get_user_pages()fails to pin the last page when the start address isn't page-aligned. The patch fixes this in a way that makesfind_extend_vma()congruent to its MMU cousin.Signed-off-by Steven J. Magnani <[email protected]>
Looks good to me. David?
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 7 lines · Paul Mundt
Quoted 5 lines
The noMMU version of
get_user_pages()fails to pin the last page when the start address isn't page-aligned. The patch fixes this in a way that makesfind_extend_vma()congruent to its MMU cousin.Signed-off-by Steven J. Magnani <[email protected]>Looks good to me. David?
I don't seem to have the original patch.
David
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>