summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mm/mmap.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/mm/mmap.c b/mm/mmap.c
index df9154b15ef9..43ef85028921 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -291,6 +291,8 @@ unsigned long do_mmap(struct file *file, unsigned long addr,
*populate = 0;
+ mmap_assert_write_locked(mm);
+
if (!len)
return -EINVAL;
@@ -1023,6 +1025,8 @@ unsigned long mmap_region(struct file *file, unsigned long addr,
unsigned long ret;
bool writable_file_mapping = false;
+ mmap_assert_write_locked(current->mm);
+
/* Check to see if MDWE is applicable. */
if (map_deny_write_exec(vm_flags, vm_flags))
return -EACCES;