[GIT PULL] Core MM fixes for 7.4-rc5
From: David Hildenbrand (Arm)
Date: Fri Nov 27 2026 - 03:59:43 EST
Hi Linus,
please pull these core-MM fixes for 7.4-rc5.
Two hotfixes and a bunch of fixes for other nasty issues we found that
I want to have fixed sooner rather than later. All got a couple of days
in -next after proper review, which is why I am rather late this week.
Cheers,
David
----------------------------------------------------------------
The following changes since commit b6a9fa34ce4187cb69d3c588a4bbffc31ce5db8f:
Linux 7.4-rc4 (2026-11-22 14:57:40 -0800)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/mm/core.git tags/mm-core-7.4-rc5
for you to fetch changes up to 450bf6e1e7ece7ea8c0253886a01c663ea7bcc1b:
Merge patch series "mm: fix deadlock on the folio lock when migrating and splitting folios" (2026-11-24 08:58:32 +0100)
----------------------------------------------------------------
Core memory management fixes for 7.4-rc5
This includes fixes to:
- THP (Transparent Huge Pages)
- MIGRATION
- SHARED MEMORY
- MADVISE
- RECLAIM
- Core MM
The main changes are:
- Fix deadlocks on the folio lock when splitting folios and when
migrating folios, triggerable by unprivileged users.
- Fix lost writes and stale reads due to stale TLB entries with delayed
rmap handling on UP, when zapping dirty file PMDs, when installing
CoW'ed folios, and when reclaim does not write back a dirty folio.
- Fix various MADV_FREE issues that can lead to data loss or exposure
of stale swap content.
- Fix various issues with device memory migration, including
use-after-free of the anon rmap, out-of-bounds array accesses and
oopses after migrating KSM folios.
- Fix a use-after-free of the mm when copy_process() fails.
- Fix a NULL pointer dereference in the shmem huge shrinker and data
loss with failed swap writes in shmem.
Signed-off-by: David Hildenbrand (Arm) <david@xxxxxxxxxx>
----------------------------------------------------------------
Chris Mason (3):
fork: clear p->mm when copy_process() fails
mm/migrate_device: fix ksmd oops on a migrated KSM page
mm/shmem: don't use the memcg of an uncharged folio
Daniel Wade (1):
mm/memory: mark unshare copies dirty to fix MADV_FREE data loss
David Hildenbrand (Arm) (9):
mm/mmu_gather: delay rmap removal on UP as well
mm/huge_memory: flush dirty file PMDs before removing rmap
mm/khugepaged: mark ptes dirty and soft-dirty on mTHP collapse
mm: flush stale TLB entries before installing a CoW'ed folio
mm/vmscan: flush deferred writable TLB entries before unlocking the folio
mm/madvise: fix MADV_FREE handling for PMD-mapped THPs
mm/huge_memory: use NOFS when allocating while splitting folios
mm/migrate: allocate destination folios before locking a batch
Merge patch series "mm: fix deadlock on the folio lock when migrating and splitting folios"
Josef Bacik (4):
mm/migrate_device: allocate THP deferred split heads
mm/migrate_device: don't collect a range twice
mm/migrate_device: don't let go of the fault page
mm/migrate_device: look up fault folio after a split
Lorenzo Stoakes (ARM) (1):
mm/migrate_device: fix use-after-free of the anon rmap
Mani Tofigh (1):
mm/shmem: don't drop a folio whose swap write failed
include/asm-generic/tlb.h | 16 ++----
include/linux/migrate.h | 1 +
kernel/fork.c | 15 +++++-
mm/huge_memory.c | 68 ++++++++++++++++--------
mm/internal.h | 1 +
mm/madvise.c | 65 +++++++++++-----------
mm/memory.c | 14 +++--
mm/migrate.c | 133 +++++++++++++++++++++++++++++++++-------------
mm/migrate_device.c | 105 ++++++++++++++++++++++++------------
mm/mmu_gather.c | 4 +-
mm/shmem.c | 45 ++++++++++++----
mm/vmscan.c | 12 ++---
12 files changed, 321 insertions(+), 158 deletions(-)