module: extend 'rodata=off' boot cmdline parameter to module mappings
authorAKASHI Takahiro <takahiro.akashi@linaro.org>
Mon, 14 Nov 2016 06:15:05 +0000 (15:15 +0900)
committerHaibo Chen <haibo.chen@nxp.com>
Thu, 12 Apr 2018 10:46:06 +0000 (18:46 +0800)
commit60b09f35cbcc2c5b6b11ede879fab90d4f723519
tree5fc8ebd9328203bad61be34a73ec69d156635523
parent6efedc1df9e1449518b897cbc09d9b1b3a03bdda
module: extend 'rodata=off' boot cmdline parameter to module mappings

commit 39290b389ea upstream.

The current "rodata=off" parameter disables read-only kernel mappings
under CONFIG_DEBUG_RODATA:
    commit d2aa1acad22f ("mm/init: Add 'rodata=off' boot cmdline parameter
    to disable read-only kernel mappings")

This patch is a logical extension to module mappings ie. read-only mappings
at module loading can be disabled even if CONFIG_DEBUG_SET_MODULE_RONX
(mainly for debug use). Please note, however, that it only affects RO/RW
permissions, keeping NX set.

This is the first step to make CONFIG_DEBUG_SET_MODULE_RONX mandatory
(always-on) in the future as CONFIG_DEBUG_RODATA on x86 and arm64.

Suggested-by: and Acked-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
Acked-by: Rusty Russell <rusty@rustcorp.com.au>
Link: http://lkml.kernel.org/r/20161114061505.15238-1-takahiro.akashi@linaro.org
Signed-off-by: Jessica Yu <jeyu@redhat.com>
Signed-off-by: Alex Shi <alex.shi@linaro.org>
Conflicts:
keeping kaiser.h in init/main.c
include/linux/init.h
init/main.c
kernel/module.c