linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH mmotm] mm: _install_special_mapping() apply VM_LOCKED_CLEAR_MASK
@ 2022-03-03  1:38 Hugh Dickins
  0 siblings, 0 replies; only message in thread
From: Hugh Dickins @ 2022-03-03  1:38 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Vlastimil Babka, linux-kernel, linux-mm

_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.

Signed-off-by: Hugh Dickins <hughd@google.com>
---
Noticed in doing mm/munlock series, but not needed as a part of that.

 mm/mmap.c | 1 +
 1 file changed, 1 insertion(+)

--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -3420,6 +3420,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;


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-03-03  1:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-03  1:38 [PATCH mmotm] mm: _install_special_mapping() apply VM_LOCKED_CLEAR_MASK Hugh Dickins

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox