summaryrefslogtreecommitdiff
path: root/mm/mmap.c
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@armlinux.org.uk>2017-07-05 11:06:59 +0100
committerRussell King <rmk+kernel@armlinux.org.uk>2017-07-05 11:06:59 +0100
commit98becb781e3e27d74efe5f3653b948d39f694cfb (patch)
tree63d7bcd1ab22c73fb2ecd1670e6bc5c67f6ab560 /mm/mmap.c
parent9e25ebfe56ece7541cd10a20d715cbdd148a2e06 (diff)
parentcd83935be8f5c28ea099ad1efa6321c737e2e12a (diff)
Merge branches 'fixes' and 'misc' into for-linus
Diffstat (limited to 'mm/mmap.c')
-rw-r--r--mm/mmap.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/mm/mmap.c b/mm/mmap.c
index f82741e199c0..c0a8bf1df665 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -3152,8 +3152,12 @@ static int special_mapping_mremap(struct vm_area_struct *new_vma)
{
struct vm_special_mapping *sm = new_vma->vm_private_data;
+ if (WARN_ON_ONCE(current->mm != new_vma->vm_mm))
+ return -EFAULT;
+
if (sm->mremap)
return sm->mremap(sm, new_vma);
+
return 0;
}