diff options
author | Hugh Dickins <hughd@google.com> | 2022-03-22 22:42:36 +0100 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2022-03-22 23:57:05 +0100 |
commit | 1fc09228846dd41444bb1ac50995d1e6c3332015 (patch) | |
tree | a2135f1822d9887c5083a70b7a8db44e1eeb848c /mm/mmap.c | |
parent | mm/memory.c: use helper macro min and max in unmap_mapping_range_tree() (diff) | |
download | linux-1fc09228846dd41444bb1ac50995d1e6c3332015.tar.xz linux-1fc09228846dd41444bb1ac50995d1e6c3332015.zip |
mm: _install_special_mapping() apply VM_LOCKED_CLEAR_MASK
_install_special_mapping() adds the VM_SPECIAL bit VM_DONTEXPAND (and
never attempts to update locked_vm), so it ought to be consistent with
mmap_region() and mlock_fixup(), making sure not to add VM_LOCKED or
VM_LOCKONFAULT. I doubt that this fixes any problem in practice: just
do it for consistency.
Link: https://lkml.kernel.org/r/a85315a9-21d1-6133-c5fc-c89863dfb25b@google.com
Signed-off-by: Hugh Dickins <hughd@google.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/mmap.c')
-rw-r--r-- | mm/mmap.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/mm/mmap.c b/mm/mmap.c index 18875c216f8d..c5c47d95b643 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -3448,6 +3448,7 @@ static struct vm_area_struct *__install_special_mapping( vma->vm_end = addr + len; vma->vm_flags = vm_flags | mm->def_flags | VM_DONTEXPAND | VM_SOFTDIRTY; + vma->vm_flags &= VM_LOCKED_CLEAR_MASK; vma->vm_page_prot = vm_get_page_prot(vma->vm_flags); vma->vm_ops = ops; |