summaryrefslogtreecommitdiffstats
path: root/mm/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/util.c')
-rw-r--r--mm/util.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/mm/util.c b/mm/util.c
index 3cb2164f4099..b8f538863b5a 100644
--- a/mm/util.c
+++ b/mm/util.c
@@ -11,6 +11,7 @@
11#include <linux/mman.h> 11#include <linux/mman.h>
12#include <linux/hugetlb.h> 12#include <linux/hugetlb.h>
13#include <linux/vmalloc.h> 13#include <linux/vmalloc.h>
14#include <linux/userfaultfd_k.h>
14 15
15#include <asm/sections.h> 16#include <asm/sections.h>
16#include <linux/uaccess.h> 17#include <linux/uaccess.h>
@@ -297,14 +298,16 @@ unsigned long vm_mmap_pgoff(struct file *file, unsigned long addr,
297 unsigned long ret; 298 unsigned long ret;
298 struct mm_struct *mm = current->mm; 299 struct mm_struct *mm = current->mm;
299 unsigned long populate; 300 unsigned long populate;
301 LIST_HEAD(uf);
300 302
301 ret = security_mmap_file(file, prot, flag); 303 ret = security_mmap_file(file, prot, flag);
302 if (!ret) { 304 if (!ret) {
303 if (down_write_killable(&mm->mmap_sem)) 305 if (down_write_killable(&mm->mmap_sem))
304 return -EINTR; 306 return -EINTR;
305 ret = do_mmap_pgoff(file, addr, len, prot, flag, pgoff, 307 ret = do_mmap_pgoff(file, addr, len, prot, flag, pgoff,
306 &populate); 308 &populate, &uf);
307 up_write(&mm->mmap_sem); 309 up_write(&mm->mmap_sem);
310 userfaultfd_unmap_complete(mm, &uf);
308 if (populate) 311 if (populate)
309 mm_populate(ret, populate); 312 mm_populate(ret, populate);
310 } 313 }