Commit 604c8e67 authored by Mark Rutland's avatar Mark Rutland Committed by Will Deacon

arm64: enable CONFIG_SET_MODULE_RONX by default

The SET_MODULE_RONX protections are effectively the same as the
DEBUG_RODATA protections we enabled by default back in commit
57efac2f ("arm64: enable CONFIG_DEBUG_RODATA by default"). It
seems unusual to have one but not the other.

As evidenced by the help text, the rationale appears to be that
SET_MODULE_RONX interacts poorly with tracing and patching, but both of
these make use of the insn framework, which takes SET_MODULE_RONX into
account. Any remaining issues are bugs which should be fixed regardless
of the default state of the option.

This patch enables DEBUG_SET_MODULE_RONX by default, and replaces the
help text with a new wording derived from the DEBUG_RODATA help text,
which better describes the functionality. Previously, the DEBUG_RODATA
entry was inconsistently indented with spaces, which are replaced with
tabs as with the other Kconfig entries.

Additionally, the wording of recommended defaults is made consistent for
all options. These are placed in a new paragraph, unquoted, as a full
sentence (with a period/full stop) as this appears to be the most common
form per $(git grep 'in doubt').

Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Laura Abbott <labbott@fedoraproject.org>
Acked-by: default avatarKees Cook <keescook@chromium.org>
Acked-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: default avatarMark Rutland <mark.rutland@arm.com>
Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
parent db413b51
...@@ -12,7 +12,8 @@ config ARM64_PTDUMP ...@@ -12,7 +12,8 @@ config ARM64_PTDUMP
who are working in architecture specific areas of the kernel. who are working in architecture specific areas of the kernel.
It is probably not a good idea to enable this feature in a production It is probably not a good idea to enable this feature in a production
kernel. kernel.
If in doubt, say "N"
If in doubt, say N.
config PID_IN_CONTEXTIDR config PID_IN_CONTEXTIDR
bool "Write the current PID to the CONTEXTIDR register" bool "Write the current PID to the CONTEXTIDR register"
...@@ -40,13 +41,13 @@ config ARM64_RANDOMIZE_TEXT_OFFSET ...@@ -40,13 +41,13 @@ config ARM64_RANDOMIZE_TEXT_OFFSET
config DEBUG_SET_MODULE_RONX config DEBUG_SET_MODULE_RONX
bool "Set loadable kernel module data as NX and text as RO" bool "Set loadable kernel module data as NX and text as RO"
depends on MODULES depends on MODULES
default y
help help
This option helps catch unintended modifications to loadable Is this is set, kernel module text and rodata will be made read-only.
kernel module's text and read-only data. It also prevents execution This is to help catch accidental or malicious attempts to change the
of module data. Such protection may interfere with run-time code kernel's executable code.
patching and dynamic kernel tracing - and they might also protect
against certain classes of kernel exploits. If in doubt, say Y.
If in doubt, say "N".
config DEBUG_RODATA config DEBUG_RODATA
bool "Make kernel text and rodata read-only" bool "Make kernel text and rodata read-only"
...@@ -56,7 +57,7 @@ config DEBUG_RODATA ...@@ -56,7 +57,7 @@ config DEBUG_RODATA
is to help catch accidental or malicious attempts to change the is to help catch accidental or malicious attempts to change the
kernel's executable code. kernel's executable code.
If in doubt, say Y If in doubt, say Y.
config DEBUG_ALIGN_RODATA config DEBUG_ALIGN_RODATA
depends on DEBUG_RODATA depends on DEBUG_RODATA
...@@ -69,7 +70,7 @@ config DEBUG_ALIGN_RODATA ...@@ -69,7 +70,7 @@ config DEBUG_ALIGN_RODATA
alignment and potentially wasted space. Turn on this option if alignment and potentially wasted space. Turn on this option if
performance is more important than memory pressure. performance is more important than memory pressure.
If in doubt, say N If in doubt, say N.
source "drivers/hwtracing/coresight/Kconfig" source "drivers/hwtracing/coresight/Kconfig"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment