]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
riscv: enable mseal sysmap for RV64
authorJisheng Zhang <jszhang@kernel.org>
Sat, 26 Apr 2025 13:59:54 +0000 (21:59 +0800)
committerPalmer Dabbelt <palmer@dabbelt.com>
Thu, 5 Jun 2025 21:03:08 +0000 (14:03 -0700)
Provide support for CONFIG_MSEAL_SYSTEM_MAPPINGS for RV64, covering the
vdso, vvar.

Passed sysmap_is_sealed and mseal_test self tests.
Passed booting a buildroot rootfs image and a cli debian rootfs image.

Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
Cc: Jeff Xu <jeffxu@chromium.org>
Link: https://lore.kernel.org/r/20250426135954.5614-1-jszhang@kernel.org
Tested-by: Alexandre Ghiti <alexghiti@rivosinc.com>
Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com>
Signed-off-by: Palmer Dabbelt <palmer@dabbelt.com>
arch/riscv/Kconfig
arch/riscv/kernel/vdso.c

index bbec87b7930999748b33df7a92aecdefcdfe624b..3cb0b05eef62f663c9bf80572b350d6367a0b9cc 100644 (file)
@@ -70,6 +70,7 @@ config RISCV
        # LLD >= 14: https://github.com/llvm/llvm-project/issues/50505
        select ARCH_SUPPORTS_LTO_CLANG if LLD_VERSION >= 140000
        select ARCH_SUPPORTS_LTO_CLANG_THIN if LLD_VERSION >= 140000
+       select ARCH_SUPPORTS_MSEAL_SYSTEM_MAPPINGS if 64BIT && MMU
        select ARCH_SUPPORTS_PAGE_TABLE_CHECK if MMU
        select ARCH_SUPPORTS_PER_VMA_LOCK if MMU
        select ARCH_SUPPORTS_RT
index cc2895d1fbc2fe752b3edc94f4e28a6a8fca7a3b..3a8e038b10a2dce9ee159232440b4c5ea0cba46b 100644 (file)
@@ -136,7 +136,7 @@ static int __setup_additional_pages(struct mm_struct *mm,
 
        ret =
           _install_special_mapping(mm, vdso_base, vdso_text_len,
-               (VM_READ | VM_EXEC | VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC),
+               (VM_READ | VM_EXEC | VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC | VM_SEALED_SYSMAP),
                vdso_info->cm);
 
        if (IS_ERR(ret))