mseal sysmap: enable s390
authorHeiko Carstens <hca@linux.ibm.com>
Tue, 11 Mar 2025 12:33:26 +0000 (13:33 +0100)
committerAndrew Morton <akpm@linux-foundation.org>
Tue, 1 Apr 2025 22:17:16 +0000 (15:17 -0700)
Provide support for CONFIG_MSEAL_SYSTEM_MAPPINGS on s390, covering the
vdso.

[hca@linux.ibm.com: update supported architectures]
Link: https://lkml.kernel.org/r/20250317131917.1332402-1-hca@linux.ibm.com
Link: https://lkml.kernel.org/r/20250311123326.2686682-3-hca@linux.ibm.com
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Reviewed-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Cc: Alexander Gordeev <agordeev@linux.ibm.com>
Cc: Christian Borntraeger <borntraeger@linux.ibm.com>
Cc: Jeff Xu <jeffxu@chromium.org>
Cc: Liam Howlett <liam.howlett@oracle.com>
Cc: Sven Schnelle <svens@linux.ibm.com>
Cc: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Cc: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Documentation/userspace-api/mseal.rst
arch/s390/Kconfig
arch/s390/kernel/vdso.c

index 56aee46a93075a983270ce17a77b592e3f2c73b1..1dabfc29be0d1f1166ffc7554d2e5c785e5d8150 100644 (file)
@@ -143,7 +143,8 @@ Use cases
   the CONFIG_MSEAL_SYSTEM_MAPPINGS seals all system mappings of this
   architecture.
 
-  The following architectures currently support this feature: x86-64 and arm64.
+  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
index c809c486d136564b07666f9ab12ebfe83a0ff47a..b8fa367c1fc99e876ec8b2484ad10a3d03369e6d 100644 (file)
@@ -137,6 +137,7 @@ config S390
        select ARCH_SUPPORTS_DEBUG_PAGEALLOC
        select ARCH_SUPPORTS_HUGETLBFS
        select ARCH_SUPPORTS_INT128 if CC_HAS_INT128 && CC_IS_CLANG
+       select ARCH_SUPPORTS_MSEAL_SYSTEM_MAPPINGS
        select ARCH_SUPPORTS_NUMA_BALANCING
        select ARCH_SUPPORTS_PER_VMA_LOCK
        select ARCH_USE_BUILTIN_BSWAP
index 70c8f9ad13cde96f0f307213bacb671b818f628b..430feb1a501366e5868b0c4d775770177fa5c6a5 100644 (file)
@@ -80,7 +80,7 @@ static int map_vdso(unsigned long addr, unsigned long vdso_mapping_len)
        vdso_text_start = vvar_start + VDSO_NR_PAGES * PAGE_SIZE;
        /* VM_MAYWRITE for COW so gdb can set breakpoints */
        vma = _install_special_mapping(mm, vdso_text_start, vdso_text_len,
-                                      VM_READ|VM_EXEC|
+                                      VM_READ|VM_EXEC|VM_SEALED_SYSMAP|
                                       VM_MAYREAD|VM_MAYWRITE|VM_MAYEXEC,
                                       vdso_mapping);
        if (IS_ERR(vma)) {