linux/kernel/module
Christophe Leroy 0597579356 module: Make module_enable_x() independent of CONFIG_ARCH_HAS_STRICT_MODULE_RWX
module_enable_x() has nothing to do with CONFIG_ARCH_HAS_STRICT_MODULE_RWX
allthough by coincidence architectures who need module_enable_x() are
selection CONFIG_ARCH_HAS_STRICT_MODULE_RWX.

Enable module_enable_x() for everyone everytime. If an architecture
already has module text set executable, it's a no-op.

Don't check text_size alignment. When CONFIG_STRICT_MODULE_RWX is set
the verification is already done in frob_rodata(). When
CONFIG_STRICT_MODULE_RWX is not set it is not a big deal to have the
start of data as executable. Just make sure we entirely get the last
page when the boundary is not aligned.

And don't BUG on misaligned base as some architectures like nios2
use kmalloc() for allocating modules. So just bail out in that case.
If that's a problem, a page fault will occur later anyway.

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
2022-04-05 08:43:04 -07:00
..
debug_kmemleak.c module: Move kmemleak support to a separate file 2022-04-05 08:43:04 -07:00
decompress.c module: Make internal.h and decompress.c more compliant 2022-04-05 08:42:35 -07:00
internal.h module: Make module_enable_x() independent of CONFIG_ARCH_HAS_STRICT_MODULE_RWX 2022-04-05 08:43:04 -07:00
kallsyms.c module: kallsyms: Fix suspicious rcu usage 2022-04-05 08:43:04 -07:00
kdb.c module: Move kdb module related code out of main kdb code 2022-04-05 08:43:04 -07:00
livepatch.c module: Move livepatch support to a separate file 2022-04-05 08:43:04 -07:00
main.c module: Make module_enable_x() independent of CONFIG_ARCH_HAS_STRICT_MODULE_RWX 2022-04-05 08:43:04 -07:00
Makefile module: Move version support into a separate file 2022-04-05 08:43:04 -07:00
procfs.c module: Move procfs support into a separate file 2022-04-05 08:43:04 -07:00
signing.c module: Move extra signature support out of core code 2022-04-05 08:43:04 -07:00
strict_rwx.c module: Move strict rwx support to a separate file 2022-04-05 08:43:04 -07:00
sysfs.c module: Move sysfs support into a separate file 2022-04-05 08:43:04 -07:00
tree_lookup.c module: Move latched RB-tree support to a separate file 2022-04-05 08:43:04 -07:00
version.c module: Move version support into a separate file 2022-04-05 08:43:04 -07:00