UPSTREAM: arm64: enable CONFIG_DEBUG_RODATA by default
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Thu, 3 Mar 2016 14:10:59 +0000 (15:10 +0100)
committerAmit Pundir <amit.pundir@linaro.org>
Mon, 2 Jan 2017 08:24:08 +0000 (13:54 +0530)
commit4e4b5185e3b9ba6e4f081ec8320c5f7008c62ac3
tree01e750534ce8f9176e6bcd4d5256f872c6a25967
parente5159b936f7237870f6e111b4409181d973a4890
UPSTREAM: arm64: enable CONFIG_DEBUG_RODATA by default

(Cherry picked from commit 57efac2f7108e3255d0dfe512290c9896f4ed55f)

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>
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
arch/arm64/Kconfig.debug