linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] mremap: don't allow VM_MIXEDMAP vma expanding
@ 2015-02-03 19:18 Shaohua Li
  2015-02-03 19:18 ` [PATCH 2/2] aio: make aio .mremap handle size changes Shaohua Li
  0 siblings, 1 reply; 9+ messages in thread
From: Shaohua Li @ 2015-02-03 19:18 UTC (permalink / raw)
  To: linux-mm
  Cc: Kernel-team, Rik van Riel, Andrew Morton, Hugh Dickins, Andy Lutomirski

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@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Hugh Dickins <hughd@google.com>
Cc: Andy Lutomirski <luto@amacapital.net>
Signed-off-by: Shaohua Li <shli@fb.com>
---
 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@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2015-02-03 23:25 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-03 19:18 [PATCH 1/2] mremap: don't allow VM_MIXEDMAP vma expanding Shaohua Li
2015-02-03 19:18 ` [PATCH 2/2] aio: make aio .mremap handle size changes Shaohua Li
2015-02-03 19:23   ` Benjamin LaHaise
2015-02-03 19:31     ` Shaohua Li
2015-02-03 19:48       ` Benjamin LaHaise
2015-02-03 21:31         ` Shaohua Li
2015-02-03 21:47           ` Benjamin LaHaise
2015-02-03 22:58             ` Shaohua Li
2015-02-03 23:25               ` Benjamin LaHaise

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox