aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm64/Kconfig.debug
diff options
context:
space:
mode:
authorArd Biesheuvel <ard.biesheuvel@linaro.org>2016-03-03 09:10:59 -0500
committerCatalin Marinas <catalin.marinas@arm.com>2016-03-03 13:14:17 -0500
commit57efac2f7108e3255d0dfe512290c9896f4ed55f (patch)
treef9337179cce2b0d9b37bb06eb698f67b6f4bec3a /arch/arm64/Kconfig.debug
parentdbd4d7ca563fd0a8949718d35ce197e5642d5d9d (diff)
arm64: enable CONFIG_DEBUG_RODATA by default
In spite of its name, CONFIG_DEBUG_RODATA is an important hardening feature for production kernels, and distros all enable it by default in their kernel configs. However, since enabling it used to result in more granular, and thus less efficient kernel mappings, it is not enabled by default for performance reasons. However, since commit 2f39b5f91eb4 ("arm64: mm: Mark .rodata as RO"), the various kernel segments (.text, .rodata, .init and .data) are already mapped individually, and the only effect of setting CONFIG_DEBUG_RODATA is that the existing .text and .rodata mappings are updated late in the boot sequence to have their read-only attributes set, which means that any performance concerns related to enabling CONFIG_DEBUG_RODATA are no longer valid. So from now on, make CONFIG_DEBUG_RODATA default to 'y' Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Acked-by: Mark Rutland <mark.rutland@arm.com> Acked-by: Kees Cook <keescook@chromium.org> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Diffstat (limited to 'arch/arm64/Kconfig.debug')
-rw-r--r--arch/arm64/Kconfig.debug6
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/arm64/Kconfig.debug b/arch/arm64/Kconfig.debug
index e13c4bf84d9e..7e76845a0434 100644
--- a/arch/arm64/Kconfig.debug
+++ b/arch/arm64/Kconfig.debug
@@ -50,13 +50,13 @@ config DEBUG_SET_MODULE_RONX
50 50
51config DEBUG_RODATA 51config DEBUG_RODATA
52 bool "Make kernel text and rodata read-only" 52 bool "Make kernel text and rodata read-only"
53 default y
53 help 54 help
54 If this is set, kernel text and rodata will be made read-only. This 55 If this is set, kernel text and rodata will be made read-only. This
55 is to help catch accidental or malicious attempts to change the 56 is to help catch accidental or malicious attempts to change the
56 kernel's executable code. Additionally splits rodata from kernel 57 kernel's executable code.
57 text so it can be made explicitly non-executable.
58 58
59 If in doubt, say Y 59 If in doubt, say Y
60 60
61config DEBUG_ALIGN_RODATA 61config DEBUG_ALIGN_RODATA
62 depends on DEBUG_RODATA && ARM64_4K_PAGES 62 depends on DEBUG_RODATA && ARM64_4K_PAGES