From: mark.rutland@arm.com (Mark Rutland)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] arm64: enable CONFIG_DEBUG_RODATA by default
Date: Thu, 3 Mar 2016 16:00:12 +0000 [thread overview]
Message-ID: <20160303160011.GF19139@leverpostej> (raw)
In-Reply-To: <1457014259-32015-1-git-send-email-ard.biesheuvel@linaro.org>
On Thu, Mar 03, 2016 at 03:10:59PM +0100, Ard Biesheuvel wrote:
> 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>
Finally! :)
Acked-by: Mark Rutland <mark.rutland@arm.com>
Mark.
> ---
> arch/arm64/Kconfig.debug | 6 +++---
> 1 file 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
>
> config DEBUG_RODATA
> bool "Make kernel text and rodata read-only"
> + default y
> help
> If this is set, kernel text and rodata will be made read-only. This
> is to help catch accidental or malicious attempts to change the
> - kernel's executable code. Additionally splits rodata from kernel
> - text so it can be made explicitly non-executable.
> + kernel's executable code.
>
> - If in doubt, say Y
> + If in doubt, say Y
>
> config DEBUG_ALIGN_RODATA
> depends on DEBUG_RODATA && ARM64_4K_PAGES
> --
> 2.5.0
>
next prev parent reply other threads:[~2016-03-03 16:00 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-03 14:10 [PATCH] arm64: enable CONFIG_DEBUG_RODATA by default Ard Biesheuvel
2016-03-03 16:00 ` Mark Rutland [this message]
2016-03-03 16:50 ` Kees Cook
2016-03-03 16:56 ` Ard Biesheuvel
2016-03-03 17:41 ` Kees Cook
2016-03-03 18:15 ` Catalin Marinas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160303160011.GF19139@leverpostej \
--to=mark.rutland@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).