From: Shaohua Li <shli@fb.com>
To: linux-mm@kvack.org
Cc: Kernel-team@fb.com, Rik van Riel <riel@redhat.com>,
Andrew Morton <akpm@linux-foundation.org>,
Hugh Dickins <hughd@google.com>,
Andy Lutomirski <luto@amacapital.net>
Subject: [PATCH 1/2] mremap: don't allow VM_MIXEDMAP vma expanding
Date: Tue, 3 Feb 2015 11:18:52 -0800 [thread overview]
Message-ID: <b885312bcea6e8c89889412936fb93305a4d139d.1422986358.git.shli@fb.com> (raw)
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>
next reply other threads:[~2015-02-03 19:19 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-03 19:18 Shaohua Li [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b885312bcea6e8c89889412936fb93305a4d139d.1422986358.git.shli@fb.com \
--to=shli@fb.com \
--cc=Kernel-team@fb.com \
--cc=akpm@linux-foundation.org \
--cc=hughd@google.com \
--cc=linux-mm@kvack.org \
--cc=luto@amacapital.net \
--cc=riel@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox