path: root/kernel/fork.c
diff options
authorAndrea Arcangeli <>2015-09-04 15:46:17 -0700
committerLinus Torvalds <>2015-09-04 16:54:41 -0700
commit16ba6f811dfe44bc14f7946a4b257b85476fc16e (patch)
treee2128e9c6849e7628c2efcd2b592eba307954201 /kernel/fork.c
parent745f234be12b6191b15eae8dd415cc81a9137f47 (diff)
userfaultfd: add VM_UFFD_MISSING and VM_UFFD_WP
These two flags gets set in vma->vm_flags to tell the VM common code if the userfaultfd is armed and in which mode (only tracking missing faults, only tracking wrprotect faults or both). If neither flags is set it means the userfaultfd is not armed on the vma. Signed-off-by: Andrea Arcangeli <> Acked-by: Pavel Emelyanov <> Cc: Sanidhya Kashyap <> Cc: Cc: "Kirill A. Shutemov" <> Cc: Andres Lagar-Cavilla <> Cc: Dave Hansen <> Cc: Paolo Bonzini <> Cc: Rik van Riel <> Cc: Mel Gorman <> Cc: Andy Lutomirski <> Cc: Hugh Dickins <> Cc: Peter Feiner <> Cc: "Dr. David Alan Gilbert" <> Cc: Johannes Weiner <> Cc: "Huangpeng (Peter)" <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
Diffstat (limited to 'kernel/fork.c')
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/fork.c b/kernel/fork.c
index ceb4eb4abb9d..7d5f0f118a63 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -454,7 +454,7 @@ static int dup_mmap(struct mm_struct *mm, struct mm_struct *oldmm)
tmp->vm_mm = mm;
if (anon_vma_fork(tmp, mpnt))
goto fail_nomem_anon_vma_fork;
- tmp->vm_flags &= ~VM_LOCKED;
+ tmp->vm_flags &= ~(VM_LOCKED|VM_UFFD_MISSING|VM_UFFD_WP);
tmp->vm_next = tmp->vm_prev = NULL;
tmp->vm_userfaultfd_ctx = NULL_VM_UFFD_CTX;
file = tmp->vm_file;