riscv: disable ARCH_HAS_STRICT_KERNEL_RWX for nommu builds
PATCH 1/1 riscv: disable ARCH_HAS_STRICT_KERNEL_RWX for nommu builds
From: "Wladimir J. van der Laan" <[email protected]>
For non-MMU systems, which tend to be low-memory SoCs such as the K210, it's expensive to align sections to 2MB. Besides that, the security guarantees cannot be made anyway.
--- arch/riscv/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/riscv/Kconfig +1 -1
@@ -60,7 +60,7 @@ config RISCV select ARCH_HAS_GIGANTIC_PAGE select ARCH_HAS_SET_DIRECT_MAP select ARCH_HAS_SET_MEMORY - select ARCH_HAS_STRICT_KERNEL_RWX + select ARCH_HAS_STRICT_KERNEL_RWX if MMU select ARCH_WANT_HUGE_PMD_SHARE if 64BIT select SPARSEMEM_STATIC if 32BIT select ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT if MMU
Signature · 1 line
2.17.1
Quoted 24 lines · Wladimir J. van der Laan
From: "Wladimir J. van der Laan" <[email protected]>
For non-MMU systems, which tend to be low-memory SoCs such as the K210, it's expensive to align sections to 2MB. Besides that, the security guarantees cannot be made anyway.
--- arch/riscv/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/riscv/Kconfig +1
-2@@ -60,7 +60,7 @@ config RISCV select ARCH_HAS_GIGANTIC_PAGE select ARCH_HAS_SET_DIRECT_MAP select ARCH_HAS_SET_MEMORY - select ARCH_HAS_STRICT_KERNEL_RWX + select ARCH_HAS_STRICT_KERNEL_RWX if MMU select ARCH_WANT_HUGE_PMD_SHARE if 64BIT select SPARSEMEM_STATIC if 32BIT select ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT if MMU --
Quoted 3 lines
2.17.1
This fix is already available in the mailing list from Damien.
https://patchwork.kernel.org/patch/11485305/
Signature · 2 lines
Regards, Atish
Palmer Dabbelt
maintainerQuoted 14 lines · On Wed, 22 Apr 2020 09:55:37 PDT (-0700), [email protected] wrote:
From: "Wladimir J. van der Laan" <[email protected]>
For non-MMU systems, which tend to be low-memory SoCs such as the K210, it's expensive to align sections to 2MB. Besides that, the security guarantees cannot be made anyway.
--- arch/riscv/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/riscv/Kconfig +0
-0
arch/riscv/Kconfig config RISCV · line 66
Quoted 8 lines
arch/riscv/Kconfig +1
-1@@ -60,7 +60,7 @@ config RISCV select ARCH_HAS_GIGANTIC_PAGE select ARCH_HAS_SET_DIRECT_MAP select ARCH_HAS_SET_MEMORY - select ARCH_HAS_STRICT_KERNEL_RWX + select ARCH_HAS_STRICT_KERNEL_RWX if MMU select ARCH_WANT_HUGE_PMD_SHARE if 64BIT select SPARSEMEM_STATIC if 32BIT select ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT if MMU
I took Damien's version because it was posted first. It had missed my inbox, so thanks for pointing this out.