Commit 1f1b6ca3145a for kernel

commit 1f1b6ca3145a1179d88b0033a871e4e187da0d4e
Merge: 5888d706750d 450bf6e1e7ec
Author: Linus Torvalds <torvalds@linux-foundation.org>
Date:   Fri Nov 27 09:10:53 2026 -0800

    Merge tag 'mm-core-7.4-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/mm/core

    Pull core MM fixes from David Hildenbrand:
     "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.

       - 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"

    * tag 'mm-core-7.4-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/mm/core:
      mm/migrate: allocate destination folios before locking a batch
      mm/huge_memory: use NOFS when allocating while splitting folios
      mm/shmem: don't drop a folio whose swap write failed
      mm/shmem: don't use the memcg of an uncharged folio
      mm/madvise: fix MADV_FREE handling for PMD-mapped THPs
      mm/vmscan: flush deferred writable TLB entries before unlocking the folio
      mm: flush stale TLB entries before installing a CoW'ed folio
      mm/migrate_device: fix use-after-free of the anon rmap
      mm/migrate_device: fix ksmd oops on a migrated KSM page
      mm/migrate_device: look up fault folio after a split
      mm/migrate_device: don't let go of the fault page
      mm/migrate_device: don't collect a range twice
      mm/migrate_device: allocate THP deferred split heads
      fork: clear p->mm when copy_process() fails
      mm/khugepaged: mark ptes dirty and soft-dirty on mTHP collapse
      mm/memory: mark unshare copies dirty to fix MADV_FREE data loss
      mm/huge_memory: flush dirty file PMDs before removing rmap
      mm/mmu_gather: delay rmap removal on UP as well