linux/mm
Lorenzo Stoakes 90888b4ae1 mm: remove unnecessary and incorrect mmap lock assert
This check was introduced by commit 42fc541404 ("mmap locking API: add
mmap_assert_locked() and mmap_assert_write_locked()") which replaced a
VM_BUG_ON_VMA() over rwsem_is_locked from commit a00cc7d9dd ("mm, x86:
add support for PUD-sized transparent hugepages"), i.e.  the commit that
introduced PUD THPs.

These seem to be careful asserts introduced to ensure that locks are held
in general, however for a zap we require that VMAs are kept stable, and
this is a requirement that has held perfectly well for a long time.

These were long before VMA locks and thus there appears to be no reason to
think this is assert is there for anything other than 'stabilised VMA'.

Asserting that the VMA under examination is stable only in the case of a
THP PUD is strange and unnecessary.  If we wish to be careful and assert
such things, we should do so at the zap level.

However in any case the current situation is already simply incorrect - a
VMA lock suffices here.

Remove the assert for now as it is unnecessarily, incorrect and unhelpful,
subsequent work can introduce an assert in general for zapping if
required.

Link: https://lkml.kernel.org/r/20260114115619.1087466-1-lorenzo.stoakes@oracle.com
Fixes: 2ab7f1bbaf ("mm/madvise: allow guard page install/remove under VMA lock")
Signed-off-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Reported-by: Chris Mason <clm@meta.com>
Closes: https://lore.kernel.org/all/20260113220856.2358195-1-clm@meta.com/
Acked-by: David Hildenbrand (Red Hat) <david@kernel.org>
Cc: Liam Howlett <liam.howlett@oracle.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: SeongJae Park <sj@kernel.org>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2026-01-20 09:34:25 -08:00
..
damon mm/damon/sysfs-scheme: cleanup access_pattern subdirs on scheme dir setup failure 2026-01-14 22:16:23 -08:00
kasan kasan: unpoison vms[area] addresses with a common tag 2025-12-23 11:23:12 -08:00
kfence Significant patch series in this merge are as follows: 2025-12-05 13:52:43 -08:00
kmsan mm: kmsan: fix poisoning of high-order non-compound pages 2026-01-14 22:16:25 -08:00
backing-dev.c Coccinelle-based conversion to use ->i_state accessors 2025-10-20 20:22:26 +02:00
balloon_compaction.c mm/migrate: fix NULL movable_ops if CONFIG_ZSMALLOC=m 2025-08-19 16:35:57 -07:00
bootmem_info.c mm/sparse: allow for alternate vmemmap section init at boot 2025-03-16 22:06:27 -07:00
cma.c mm/cma: refuse handing out non-contiguous page ranges 2025-09-21 14:22:06 -07:00
cma.h mm: cma: set early_pfn and bitmap as a union in cma_memrange 2025-05-22 14:55:36 -07:00
cma_debug.c mm: cma: simplify cma_maxchunk_get() 2025-07-24 19:12:36 -07:00
cma_sysfs.c mm/cma: export total and free number of pages for CMA areas 2025-03-16 22:06:24 -07:00
compaction.c mm/compaction: fix low_pfn advance on isolating hugetlb 2025-09-28 11:51:29 -07:00
debug.c mm: constify __dump_folio() arguments 2025-11-20 13:43:57 -08:00
debug_page_alloc.c mm/debug_page_alloc: improve error message for invalid guardpage minorder 2025-05-12 23:50:38 -07:00
debug_page_ref.c
debug_vm_pgtable.c mm: softdirty: add pgtable_supports_soft_dirty() 2025-11-24 15:08:54 -08:00
dmapool.c docs: dma-api: replace consistent with coherent 2025-07-01 13:25:36 -06:00
dmapool_test.c
early_ioremap.c mm/early_ioremap: add null pointer checks to prevent NULL-pointer dereference 2025-01-13 22:40:59 -08:00
execmem.c mm: remove PMD alignment constraint in execmem_vmalloc() 2025-09-28 11:51:31 -07:00
fadvise.c mm: rename filemap_fdatawrite_range_kick to filemap_flush_range 2025-10-29 15:50:42 +01:00
fail_page_alloc.c
failslab.c
filemap.c ARM: 2025-12-05 17:01:20 -08:00
folio-compat.c mm: Remove grab_cache_page_write_begin() 2025-03-04 17:02:25 +00:00
gup.c mm: replace READ_ONCE() with standard page table accessors 2025-11-16 17:27:56 -08:00
gup_test.c
gup_test.h
highmem.c mm: constify highmem related functions for improved const-correctness 2025-09-21 14:22:15 -07:00
hmm.c Significant patch series in this merge are as follows: 2025-12-05 13:52:43 -08:00
huge_memory.c Patch series in this pull request: 2025-12-13 20:35:41 +12:00
hugetlb.c mm/hugetlb: ignore hugepage kernel args if hugepages are unsupported 2026-01-14 22:16:22 -08:00
hugetlb_cgroup.c page_counter: track failcnt only for legacy cgroups 2025-03-17 00:05:35 -07:00
hugetlb_cma.c mm: hugetlb: directly pass order when allocate a hugetlb folio 2025-09-21 14:22:11 -07:00
hugetlb_cma.h mm: hugetlb: directly pass order when allocate a hugetlb folio 2025-09-21 14:22:11 -07:00
hugetlb_internal.h mm/hugetlb: extract sysctl into hugetlb_sysctl.c 2025-11-20 13:43:57 -08:00
hugetlb_sysctl.c mm/hugetlb: extract sysctl into hugetlb_sysctl.c 2025-11-20 13:43:57 -08:00
hugetlb_sysfs.c mm/hugetlb: extract sysfs into hugetlb_sysfs.c 2025-11-20 13:43:57 -08:00
hugetlb_vmemmap.c treewide: include linux/pgalloc.h instead of asm/pgalloc.h 2025-11-16 17:28:25 -08:00
hugetlb_vmemmap.h mm/hugetlb: do pre-HVO for bootmem allocated pages 2025-03-16 22:06:29 -07:00
hwpoison-inject.c mm/hwpoison: decouple hwpoison_filter from mm/memory-failure.c 2025-09-21 14:22:21 -07:00
init-mm.c mm: rename cpu_bitmap field to flexible_array 2026-01-19 12:30:00 -08:00
internal.h Significant patch series in this pull request: 2025-12-06 14:01:20 -08:00
interval_tree.c
ioremap.c mm/ioremap: pass pgprot_t to ioremap_prot() instead of unsigned long 2025-03-16 22:06:23 -07:00
Kconfig x86/kaslr: Recognize all ZONE_DEVICE users as physaddr consumers 2026-01-05 18:05:55 -07:00
Kconfig.debug mm: fix DEBUG_RODATA_TEST indentation in Kconfig 2025-11-29 10:41:09 -08:00
khugepaged.c mm: declare VMA flags by bit 2025-11-29 10:41:08 -08:00
kmemleak.c mm: fix possible deadlock in kmemleak 2025-09-01 17:11:37 -07:00
ksm.c mm/ksm: fix pte_unmap_unlock of wrong address in break_ksm_pmd_entry 2025-12-23 11:23:17 -08:00
list_lru.c mm, list_lru: refactor the locking code 2025-07-09 22:41:56 -07:00
maccess.c mm: unexport globally copy_to_kernel_nofault 2025-07-09 22:42:22 -07:00
madvise.c mm: declare VMA flags by bit 2025-11-29 10:41:08 -08:00
Makefile Significant patch series in this pull request: 2025-12-06 14:01:20 -08:00
mapping_dirty_helpers.c mm/dirty: replace READ_ONCE() with pudp_get() 2025-11-16 17:27:58 -08:00
memblock.c Significant patch series in this pull request: 2025-12-06 14:01:20 -08:00
memcontrol-v1.c mm/memcg: v1: account event registrations and drop world-writable cgroup.event_control 2025-09-21 14:22:26 -07:00
memcontrol-v1.h memcg: move do_memsw_account() to CONFIG_MEMCG_V1 2025-03-21 22:03:11 -07:00
memcontrol.c mm: memcg: fix unit conversion for K() macro in OOM log 2025-12-23 11:23:15 -08:00
memfd.c selinux/stable-6.19 PR 20251201 2025-12-03 10:45:47 -08:00
memfd_luo.c mm: memfd_luo: allow preserving memfd 2025-11-27 14:24:41 -08:00
memory-failure.c mm: fixup pfnmap memory failure handling to use pgoff 2025-12-23 11:23:15 -08:00
memory-tiers.c mm: fix some typos in mm module 2025-11-16 17:27:52 -08:00
memory.c mm: remove unnecessary and incorrect mmap lock assert 2026-01-20 09:34:25 -08:00
memory_hotplug.c Significant patch series in this merge are as follows: 2025-12-05 13:52:43 -08:00
mempolicy.c ARM: 2025-12-05 17:01:20 -08:00
mempool.c slab updates for 6.19 2025-12-03 11:53:47 -08:00
memremap.c mm/memremap: fix spurious large folio warning for FS-DAX 2025-12-23 11:23:16 -08:00
memtest.c
migrate.c migrate: correct lock ordering for hugetlb file folios 2026-01-19 12:30:01 -08:00
migrate_device.c mm/huge_memory.c: introduce folio_split_unmapped 2025-11-24 15:08:53 -08:00
mincore.c mm: replace remaining pte_to_swp_entry() with softleaf_from_pte() 2025-11-24 15:08:52 -08:00
mlock.c mm: update vma_modify_flags() to handle residual flags, document 2025-11-20 13:43:58 -08:00
mm_init.c memblock: introduce check_pages boot parameter 2025-12-07 08:56:10 -08:00
mm_slot.h
mmap.c mm: softdirty: add pgtable_supports_soft_dirty() 2025-11-24 15:08:54 -08:00
mmap_lock.c mm: fix vma_start_write_killable() signal handling 2025-11-29 10:41:11 -08:00
mmu_gather.c treewide: include linux/pgalloc.h instead of asm/pgalloc.h 2025-11-16 17:28:25 -08:00
mmu_notifier.c Update Christoph's Email address and make it consistent 2025-05-12 23:50:31 -07:00
mmzone.c mm: introduce memdesc_flags_t 2025-09-13 16:55:07 -07:00
mprotect.c mm: eliminate further swapops predicates 2025-11-24 15:08:52 -08:00
mremap.c mm: softdirty: add pgtable_supports_soft_dirty() 2025-11-24 15:08:54 -08:00
mseal.c mm: update vma_modify_flags() to handle residual flags, document 2025-11-20 13:43:58 -08:00
msync.c
nommu.c mm/nommu: convert kobjsize() to folios 2025-09-13 16:54:46 -07:00
numa.c mm/numa: remove unnecessary local variable in alloc_node_data() 2025-05-12 23:50:38 -07:00
numa_emulation.c mm: numa,memblock: Use SZ_1M macro to denote bytes to MB conversion 2025-08-20 16:31:23 +03:00
numa_memblks.c mm: numa,memblock: include <asm/numa.h> for 'numa_nodes_parsed' 2026-01-14 22:16:26 -08:00
oom_kill.c mm: memcg: dump memcg protection info on oom or alloc failures 2025-11-20 13:43:59 -08:00
page-writeback.c Significant patch series in this merge are as follows: 2025-12-05 13:52:43 -08:00
page_alloc.c mm/page_alloc: prevent pcp corruption with SMP=n 2026-01-14 22:16:25 -08:00
page_counter.c page_counter: track failcnt only for legacy cgroups 2025-03-17 00:05:35 -07:00
page_ext.c mm,page_ext: derive the node from the pfn 2025-07-13 16:38:16 -07:00
page_frag_cache.c mm/page_alloc: export free_frozen_pages() instead of free_unref_page() 2025-01-13 22:40:31 -08:00
page_idle.c mm/rmap: extend rmap and migration support device-private entries 2025-11-24 15:08:48 -08:00
page_io.c mm, swap: tidy up swap device and cluster info helpers 2025-09-21 14:22:23 -07:00
page_isolation.c mm/page_isolation: drop __folio_test_movable() check for large folios 2025-07-13 16:38:29 -07:00
page_owner.c mm/page_owner: fix memory leak in page_owner_stack_fops->release() 2025-12-23 11:23:17 -08:00
page_poison.c
page_reporting.c
page_reporting.h
page_table_check.c mm: replace pmd_to_swp_entry() with softleaf_from_pmd() 2025-11-24 15:08:51 -08:00
page_vma_mapped.c mm: eliminate further swapops predicates 2025-11-24 15:08:52 -08:00
pagewalk.c mm: eliminate further swapops predicates 2025-11-24 15:08:52 -08:00
percpu-internal.h
percpu-km.c mm/mm/percpu-km: drop nth_page() usage within single allocation 2025-09-21 14:22:04 -07:00
percpu-stats.c mm: remove outdated filename comment in percpu-stats.c 2025-07-13 16:38:23 -07:00
percpu-vm.c kmsan: remove hard-coded GFP_KERNEL flags 2025-11-16 17:27:54 -08:00
percpu.c percpu: fix race on alloc failed warning limit 2025-09-08 23:45:10 -07:00
pgalloc-track.h
pgtable-generic.c mm/huge_memory: add device-private THP support to PMD operations 2025-11-24 15:08:48 -08:00
process_vm_access.c mm: refactor mm_access() to not return NULL 2024-11-05 16:56:23 -08:00
pt_reclaim.c treewide: include linux/pgalloc.h instead of asm/pgalloc.h 2025-11-16 17:28:25 -08:00
ptdump.c mm/ptdump: replace READ_ONCE() with standard page table accessors 2025-11-16 17:27:52 -08:00
readahead.c mm/filemap: Add NUMA mempolicy support to filemap_alloc_folio() 2025-10-20 06:30:25 -07:00
rmap.c memcg: remove __lruvec_stat_mod_folio 2025-11-24 15:08:54 -08:00
rodata_test.c mm/rodata_test: verify test data is unchanged, rather than non-zero 2025-01-13 22:40:38 -08:00
secretmem.c Significant patch series in this merge are as follows: 2025-12-05 13:52:43 -08:00
shmem.c a couple of shmem rename fixes - recent regression from tree-in-dcache 2025-12-16 19:44:36 +12:00
shmem_quota.c
show_mem.c mm: re-enable kswapd when memory pressure subsides or demotion is toggled 2025-09-21 14:22:29 -07:00
shrinker.c mm: shrinker: avoid memleak in alloc_shrinker_info 2024-10-31 20:27:04 -07:00
shrinker_debug.c mm/shrinker: fix name consistency issue in shrinker_debugfs_rename() 2025-03-17 00:05:40 -07:00
shuffle.c
shuffle.h
slab.h mm/slab: introduce kvfree_rcu_barrier_on_cache() for cache destruction 2025-12-07 18:09:54 +01:00
slab_common.c slab fix for 6.19-rc1 2025-12-11 08:54:08 +09:00
slub.c slab fix for 6.19-rc2 2025-12-20 11:24:42 -08:00
sparse-vmemmap.c mm: replace READ_ONCE() with standard page table accessors 2025-11-16 17:27:56 -08:00
sparse.c mm/memory_hotplug: Remove MEM_PREPARE_ONLINE/MEM_FINISH_OFFLINE notifiers 2025-10-14 14:24:53 +02:00
swap.c mm: lru_add_drain_all() do local lru_add_drain() first 2025-09-21 14:22:32 -07:00
swap.h mm/migrate, swap: drop usage of folio_index 2025-11-16 17:28:20 -08:00
swap_cgroup.c mm: swap_cgroup: remove double initialization of locals 2025-03-17 22:06:58 -07:00
swap_state.c mm, swap: remove redundant comment for read_swap_cache_async 2025-11-24 15:08:56 -08:00
swap_table.h mm, swap: use a single page for swap table when the size fits 2025-09-21 14:22:25 -07:00
swapfile.c mm/swapfile: use plist_for_each_entry in __folio_throttle_swaprate 2025-11-29 10:41:11 -08:00
truncate.c vfs-6.19-rc1.folio 2025-12-01 10:26:38 -08:00
usercopy.c usercopy: Remove folio references from check_heap_object() 2025-11-13 11:01:08 +01:00
userfaultfd.c mm: softdirty: add pgtable_supports_soft_dirty() 2025-11-24 15:08:54 -08:00
util.c mm: add ability to take further action in vm_area_desc 2025-11-16 17:28:12 -08:00
vma.c mm/vma: do not leak memory when .mmap_prepare swaps the file 2026-01-19 12:30:01 -08:00
vma.h mm/vma: fix anon_vma UAF on mremap() faulted, unfaulted merge 2026-01-14 22:16:24 -08:00
vma_exec.c mm: softdirty: add pgtable_supports_soft_dirty() 2025-11-24 15:08:54 -08:00
vma_init.c Summary of significant series in this pull request: 2025-10-02 18:18:33 -07:00
vma_internal.h mm/vma: move brk() internals to mm/vma.c 2025-01-13 22:40:42 -08:00
vmalloc.c mm: vmalloc: fix up vrealloc_node_align() kernel-doc macro name 2026-01-14 22:16:20 -08:00
vmpressure.c memcg: convert memcg->socket_pressure to u64 2025-07-24 19:12:32 -07:00
vmscan.c Patch series in this pull request: 2025-12-13 20:35:41 +12:00
vmstat.c mm: vmstat: correct the comment above preempt_disable_nested() 2025-11-20 13:43:59 -08:00
workingset.c Significant patch series in this merge are as follows: 2025-12-05 13:52:43 -08:00
zpdesc.h mm: zpdesc: minor naming and comment corrections 2025-09-21 14:21:59 -07:00
zsmalloc.c mm: remove unused zpool layer 2025-09-21 14:21:59 -07:00
zswap.c mm/zswap: fix error pointer free in zswap_cpu_comp_prepare() 2026-01-14 22:16:24 -08:00