WSL2-Linux-Kernel/mm
Mike Kravetz e700898fa0 hugetlb: really allocate vma lock for all sharable vmas
Commit bbff39cc6c ("hugetlb: allocate vma lock for all sharable vmas")
removed the pmd sharable checks in the vma lock helper routines.  However,
it left the functional version of helper routines behind #ifdef
CONFIG_ARCH_WANT_HUGE_PMD_SHARE.  Therefore, the vma lock is not being
used for sharable vmas on architectures that do not support pmd sharing. 
On these architectures, a potential fault/truncation race is exposed that
could leave pages in a hugetlb file past i_size until the file is removed.

Move the functional vma lock helpers outside the ifdef, and remove the
non-functional stubs.  Since the vma lock is not just for pmd sharing,
rename the routine __vma_shareable_flags_pmd.

Link: https://lkml.kernel.org/r/20221212235042.178355-1-mike.kravetz@oracle.com
Fixes: bbff39cc6c ("hugetlb: allocate vma lock for all sharable vmas")
Signed-off-by: Mike Kravetz <mike.kravetz@oracle.com>
Reviewed-by: Miaohe Lin <linmiaohe@huawei.com>
Cc: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: James Houghton <jthoughton@google.com>
Cc: Mina Almasry <almasrymina@google.com>
Cc: Muchun Song <songmuchun@bytedance.com>
Cc: Naoya Horiguchi <naoya.horiguchi@linux.dev>
Cc: Peter Xu <peterx@redhat.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2022-12-21 14:31:52 -08:00
..
damon
kasan hardening updates for v6.2-rc1 2022-12-14 12:20:00 -08:00
kfence hardening updates for v6.2-rc1 2022-12-14 12:20:00 -08:00
kmsan kmsan: export kmsan_handle_urb 2022-12-21 14:31:52 -08:00
Kconfig New Feature: 2022-12-17 14:06:53 -06:00
Kconfig.debug
Makefile
backing-dev.c
balloon_compaction.c
bootmem_info.c
cma.c
cma.h
cma_debug.c
cma_sysfs.c
compaction.c
debug.c
debug_page_ref.c
debug_vm_pgtable.c
dmapool.c
early_ioremap.c
fadvise.c
failslab.c
filemap.c
folio-compat.c
frontswap.c
gup.c New Feature: 2022-12-17 14:06:53 -06:00
gup_test.c mm/gup_test: free memory allocated via kvcalloc() using kvfree() 2022-12-15 16:37:48 -08:00
gup_test.h
highmem.c
hmm.c mm: Remove pointless barrier() after pmdp_get_lockless() 2022-12-15 10:37:27 -08:00
huge_memory.c ARM64: 2022-12-15 11:12:21 -08:00
hugetlb.c hugetlb: really allocate vma lock for all sharable vmas 2022-12-21 14:31:52 -08:00
hugetlb_cgroup.c
hugetlb_vmemmap.c
hugetlb_vmemmap.h
hwpoison-inject.c
init-mm.c
internal.h
interval_tree.c
io-mapping.c
ioremap.c
khugepaged.c New Feature: 2022-12-17 14:06:53 -06:00
kmemleak.c mm/kmemleak: use %pK to display kernel pointers in backtrace 2022-12-15 16:37:49 -08:00
ksm.c
list_lru.c
maccess.c
madvise.c MM patches for 6.2-rc1. 2022-12-13 19:29:45 -08:00
mapping_dirty_helpers.c mm: Rename pmd_read_atomic() 2022-12-15 10:37:27 -08:00
memblock.c
memcontrol.c
memfd.c
memory-failure.c
memory-tiers.c
memory.c
memory_hotplug.c
mempolicy.c mm/mempolicy: fix memory leak in set_mempolicy_home_node system call 2022-12-21 14:31:51 -08:00
mempool.c
memremap.c
memtest.c
migrate.c MM patches for 6.2-rc1. 2022-12-13 19:29:45 -08:00
migrate_device.c
mincore.c
mlock.c
mm_init.c
mm_slot.h
mmap.c MM patches for 6.2-rc1. 2022-12-13 19:29:45 -08:00
mmap_lock.c
mmu_gather.c
mmu_notifier.c
mmzone.c
mprotect.c New Feature: 2022-12-17 14:06:53 -06:00
mremap.c mm, mremap: fix mremap() expanding vma with addr inside vma 2022-12-21 14:31:51 -08:00
msync.c
nommu.c
oom_kill.c
page-writeback.c
page_alloc.c
page_counter.c
page_ext.c
page_idle.c
page_io.c
page_isolation.c
page_owner.c
page_poison.c
page_reporting.c
page_reporting.h
page_table_check.c
page_vma_mapped.c
pagewalk.c
percpu-internal.h
percpu-km.c
percpu-stats.c
percpu-vm.c
percpu.c
pgalloc-track.h
pgtable-generic.c
process_vm_access.c
ptdump.c
readahead.c
rmap.c
rodata_test.c
secretmem.c
shmem.c MM patches for 6.2-rc1. 2022-12-13 19:29:45 -08:00
shrinker_debug.c
shuffle.c
shuffle.h
slab.c
slab.h
slab_common.c hardening updates for v6.2-rc1 2022-12-14 12:20:00 -08:00
slob.c
slub.c MM patches for 6.2-rc1. 2022-12-13 19:29:45 -08:00
sparse-vmemmap.c
sparse.c
swap.c
swap.h
swap_cgroup.c
swap_slots.c
swap_state.c
swapfile.c MM patches for 6.2-rc1. 2022-12-13 19:29:45 -08:00
truncate.c
usercopy.c
userfaultfd.c New Feature: 2022-12-17 14:06:53 -06:00
util.c
vmalloc.c
vmpressure.c
vmscan.c New Feature: 2022-12-17 14:06:53 -06:00
vmstat.c
workingset.c
z3fold.c
zbud.c
zpool.c
zsmalloc.c
zswap.c