Commit 8c7c1b55 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'mm-stable-2025-04-02-22-07' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

Pull more MM updates from Andrew Morton:

 - The series "mm: fixes for fallouts from mem_init() cleanup" from Mike
   Rapoport fixes a couple of issues with the just-merged "arch, mm:
   reduce code duplication in mem_init()" series

 - The series "MAINTAINERS: add my isub-entries to MM part." from Mike
   Rapoport does some maintenance on MAINTAINERS

 - The series "remove tlb_remove_page_ptdesc()" from Qi Zheng does some
   cleanup work to the page mapping code

 - The series "mseal system mappings" from Jeff Xu permits sealing of
   "system mappings", such as vdso, vvar, vvar_vclock, vectors (arm
   compat-mode), sigpage (arm compat-mode)

 - Plus the usual shower of singleton patches

* tag 'mm-stable-2025-04-02-22-07' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: (31 commits)
  mseal sysmap: add arch-support txt
  mseal sysmap: enable s390
  selftest: test system mappings are sealed
  mseal sysmap: update mseal.rst
  mseal sysmap: uprobe mapping
  mseal sysmap: enable arm64
  mseal sysmap: enable x86-64
  mseal sysmap: generic vdso vvar mapping
  selftests: x86: test_mremap_vdso: skip if vdso is msealed
  mseal sysmap: kernel config and header change
  mm: pgtable: remove tlb_remove_page_ptdesc()
  x86: pgtable: convert to use tlb_remove_ptdesc()
  riscv: pgtable: unconditionally use tlb_remove_ptdesc()
  mm: pgtable: convert some architectures to use tlb_remove_ptdesc()
  mm: pgtable: change pt parameter of tlb_remove_ptdesc() to struct ptdesc*
  mm: pgtable: make generic tlb_remove_table() use struct ptdesc
  microblaze/mm: put mm_cmdline_setup() in .init.text section
  mm/memory_hotplug: fix call folio_test_large with tail page in do_migrate_range
  MAINTAINERS: mm: add entry for secretmem
  MAINTAINERS: mm: add entry for numa memblocks and numa emulation
  ...
parents 204e9a18 e20706d5
Loading
Loading
Loading
Loading
+30 −0
Original line number Diff line number Diff line
#
# Feature name:          mseal-system-mappings
#         Kconfig:       ARCH_SUPPORTS_MSEAL_SYSTEM_MAPPINGS
#         description:   arch supports mseal system mappings
#
    -----------------------
    |         arch |status|
    -----------------------
    |       alpha: | TODO |
    |         arc: |  N/A |
    |         arm: |  N/A |
    |       arm64: |  ok  |
    |        csky: |  N/A |
    |     hexagon: |  N/A |
    |   loongarch: | TODO |
    |        m68k: |  N/A |
    |  microblaze: |  N/A |
    |        mips: | TODO |
    |       nios2: |  N/A |
    |    openrisc: |  N/A |
    |      parisc: | TODO |
    |     powerpc: | TODO |
    |       riscv: | TODO |
    |        s390: |  ok  |
    |          sh: |  N/A |
    |       sparc: | TODO |
    |          um: | TODO |
    |         x86: |  ok  |
    |      xtensa: |  N/A |
    -----------------------
+21 −0
Original line number Diff line number Diff line
@@ -130,6 +130,27 @@ Use cases

- Chrome browser: protect some security sensitive data structures.

- System mappings:
  The system mappings are created by the kernel and includes vdso, vvar,
  vvar_vclock, vectors (arm compat-mode), sigpage (arm compat-mode), uprobes.

  Those system mappings are readonly only or execute only, memory sealing can
  protect them from ever changing to writable or unmmap/remapped as different
  attributes. This is useful to mitigate memory corruption issues where a
  corrupted pointer is passed to a memory management system.

  If supported by an architecture (CONFIG_ARCH_SUPPORTS_MSEAL_SYSTEM_MAPPINGS),
  the CONFIG_MSEAL_SYSTEM_MAPPINGS seals all system mappings of this
  architecture.

  The following architectures currently support this feature: x86-64, arm64,
  and s390.

  WARNING: This feature breaks programs which rely on relocating
  or unmapping system mappings. Known broken software at the time
  of writing includes CHECKPOINT_RESTORE, UML, gVisor, rr. Therefore
  this config can't be enabled universally.

When not to use mseal
=====================
Applications can apply sealing to any virtual memory region from userspace,
+39 −0
Original line number Diff line number Diff line
@@ -15487,6 +15487,45 @@ F: tools/mm/
F:	tools/testing/selftests/mm/
N:	include/linux/page[-_]*
MEMORY MANAGEMENT - EXECMEM
M:	Andrew Morton <akpm@linux-foundation.org>
M:	Mike Rapoport <rppt@kernel.org>
L:	linux-mm@kvack.org
S:	Maintained
F:	include/linux/execmem.h
F:	mm/execmem.c
MEMORY MANAGEMENT - NUMA MEMBLOCKS AND NUMA EMULATION
M:	Andrew Morton <akpm@linux-foundation.org>
M:	Mike Rapoport <rppt@kernel.org>
L:	linux-mm@kvack.org
S:	Maintained
F:	include/linux/numa_memblks.h
F:	mm/numa.c
F:	mm/numa_emulation.c
F:	mm/numa_memblks.c
MEMORY MANAGEMENT - SECRETMEM
M:	Andrew Morton <akpm@linux-foundation.org>
M:	Mike Rapoport <rppt@kernel.org>
L:	linux-mm@kvack.org
S:	Maintained
F:	include/linux/secretmem.h
F:	mm/secretmem.c
MEMORY MANAGEMENT - USERFAULTFD
M:	Andrew Morton <akpm@linux-foundation.org>
R:	Peter Xu <peterx@redhat.com>
L:	linux-mm@kvack.org
S:	Maintained
F:	Documentation/admin-guide/mm/userfaultfd.rst
F:	fs/userfaultfd.c
F:	include/asm-generic/pgtable_uffd.h
F:	include/linux/userfaultfd_k.h
F:	include/uapi/linux/userfaultfd.h
F:	mm/userfaultfd.c
F:	tools/testing/selftests/mm/uffd-*.[ch]
MEMORY MAPPING
M:	Andrew Morton <akpm@linux-foundation.org>
M:	Liam R. Howlett <Liam.Howlett@oracle.com>
+1 −0
Original line number Diff line number Diff line
@@ -38,6 +38,7 @@ config ARM64
	select ARCH_HAS_KEEPINITRD
	select ARCH_HAS_MEMBARRIER_SYNC_CORE
	select ARCH_HAS_MEM_ENCRYPT
	select ARCH_SUPPORTS_MSEAL_SYSTEM_MAPPINGS
	select ARCH_HAS_NMI_SAFE_THIS_CPU_OPS
	select ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE
	select ARCH_HAS_NONLEAF_PMD_YOUNG if ARM64_HAFT
+6 −3
Original line number Diff line number Diff line
@@ -130,7 +130,8 @@ static int __setup_additional_pages(enum vdso_abi abi,
	mm->context.vdso = (void *)vdso_base;
	ret = _install_special_mapping(mm, vdso_base, vdso_text_len,
				       VM_READ|VM_EXEC|gp_flags|
				       VM_MAYREAD|VM_MAYWRITE|VM_MAYEXEC,
				       VM_MAYREAD|VM_MAYWRITE|VM_MAYEXEC|
				       VM_SEALED_SYSMAP,
				       vdso_info[abi].cm);
	if (IS_ERR(ret))
		goto up_fail;
@@ -256,7 +257,8 @@ static int aarch32_kuser_helpers_setup(struct mm_struct *mm)
	 */
	ret = _install_special_mapping(mm, AARCH32_VECTORS_BASE, PAGE_SIZE,
				       VM_READ | VM_EXEC |
				       VM_MAYREAD | VM_MAYEXEC,
				       VM_MAYREAD | VM_MAYEXEC |
				       VM_SEALED_SYSMAP,
				       &aarch32_vdso_maps[AA32_MAP_VECTORS]);

	return PTR_ERR_OR_ZERO(ret);
@@ -279,7 +281,8 @@ static int aarch32_sigreturn_setup(struct mm_struct *mm)
	 */
	ret = _install_special_mapping(mm, addr, PAGE_SIZE,
				       VM_READ | VM_EXEC | VM_MAYREAD |
				       VM_MAYWRITE | VM_MAYEXEC,
				       VM_MAYWRITE | VM_MAYEXEC |
				       VM_SEALED_SYSMAP,
				       &aarch32_vdso_maps[AA32_MAP_SIGPAGE]);
	if (IS_ERR(ret))
		goto out;
Loading