[PATCH 1/2] mremap: don't allow VM_MIXEDMAP vma expanding

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Drivers using vm_insert_page() will set VM_MIXEDMAP, but their .fault
handler are likely not prepared to handle expansion.

Cc: Rik van Riel <riel@xxxxxxxxxx>
Cc: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
Cc: Hugh Dickins <hughd@xxxxxxxxxx>
Cc: Andy Lutomirski <luto@xxxxxxxxxxxxxx>
Signed-off-by: Shaohua Li <shli@xxxxxx>
---
 mm/mremap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/mremap.c b/mm/mremap.c
index 17fa018..3b886dc 100644
--- a/mm/mremap.c
+++ b/mm/mremap.c
@@ -354,7 +354,7 @@ static struct vm_area_struct *vma_to_resize(unsigned long addr,
 	if (new_len > old_len) {
 		unsigned long pgoff;
 
-		if (vma->vm_flags & (VM_DONTEXPAND | VM_PFNMAP))
+		if (vma->vm_flags & (VM_DONTEXPAND | VM_PFNMAP | VM_MIXEDMAP))
 			goto Efault;
 		pgoff = (addr - vma->vm_start) >> PAGE_SHIFT;
 		pgoff += vma->vm_pgoff;
-- 
1.8.1

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]