From: Russell Currey <ruscur@russell.cc>
To: linuxppc-dev@lists.ozlabs.org
Cc: Russell Currey <ruscur@russell.cc>,
christophe.leroy@c-s.fr, joel@jms.id.au, mpe@ellerman.id.au,
ajd@linux.ibm.com, dja@axtens.net, npiggin@gmail.com,
kernel-hardening@lists.openwall.com
Subject: [PATCH v4 4/4] powerpc: Enable STRICT_MODULE_RWX
Date: Mon, 14 Oct 2019 16:13:20 +1100 [thread overview]
Message-ID: <20191014051320.158682-5-ruscur@russell.cc> (raw)
In-Reply-To: <20191014051320.158682-1-ruscur@russell.cc>
Whether STRICT_MODULE_RWX is enabled by default depends on powerpc
platform - in arch/Kconfig, STRICT_MODULE_RWX depends on
ARCH_OPTIONAL_KERNEL_RWX, which in arch/powerpc/Kconfig is selected if
ARCH_HAS_STRICT_KERNEL_RWX is selected, which is only true with
CONFIG_RELOCATABLE *disabled*.
defconfigs like skiroot_defconfig which turn STRICT_KERNEL_RWX on when
it is not already on by default also do NOT enable STRICT_MODULE_RWX
automatically, so it is explicitly enabled there in this patch.
Thus, on by default for ppc32 only. Module RWX doesn't provide a whole
lot of value with Kernel RWX off, but it doesn't hurt, either. The next
step is to make STRICT_KERNEL_RWX compatible with RELOCATABLE so it can
be on by default.
Tested-by: Daniel Axtens <dja@axtens.net> # e6500
Signed-off-by: Russell Currey <ruscur@russell.cc>
---
arch/powerpc/Kconfig | 1 +
arch/powerpc/configs/skiroot_defconfig | 1 +
2 files changed, 2 insertions(+)
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 8f7005f0d097..212c4d02be40 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -135,6 +135,7 @@ config PPC
select ARCH_HAS_SCALED_CPUTIME if VIRT_CPU_ACCOUNTING_NATIVE && PPC_BOOK3S_64
select ARCH_HAS_SET_MEMORY
select ARCH_HAS_STRICT_KERNEL_RWX if ((PPC_BOOK3S_64 || PPC32) && !RELOCATABLE && !HIBERNATION)
+ select ARCH_HAS_STRICT_MODULE_RWX
select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST
select ARCH_HAS_UACCESS_FLUSHCACHE
select ARCH_HAS_UACCESS_MCSAFE if PPC64
diff --git a/arch/powerpc/configs/skiroot_defconfig b/arch/powerpc/configs/skiroot_defconfig
index 1253482a67c0..719d899081b3 100644
--- a/arch/powerpc/configs/skiroot_defconfig
+++ b/arch/powerpc/configs/skiroot_defconfig
@@ -31,6 +31,7 @@ CONFIG_PERF_EVENTS=y
CONFIG_SLAB_FREELIST_HARDENED=y
CONFIG_JUMP_LABEL=y
CONFIG_STRICT_KERNEL_RWX=y
+CONFIG_STRICT_MODULE_RWX=y
CONFIG_MODULES=y
CONFIG_MODULE_UNLOAD=y
CONFIG_MODULE_SIG=y
--
2.23.0
next prev parent reply other threads:[~2019-10-14 5:14 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-14 5:13 [PATCH v4 0/4] Implement STRICT_MODULE_RWX for powerpc Russell Currey
2019-10-14 5:13 ` [PATCH v4 1/4] powerpc/mm: Implement set_memory() routines Russell Currey
2019-10-14 5:13 ` [PATCH v4 2/4] powerpc/kprobes: Mark newly allocated probes as RO Russell Currey
2019-10-14 5:13 ` [PATCH v4 3/4] powerpc/mm/ptdump: debugfs handler for W+X checks at runtime Russell Currey
2019-10-14 5:13 ` Russell Currey [this message]
2019-10-29 23:02 ` [PATCH v4 0/4] Implement STRICT_MODULE_RWX for powerpc Kees Cook
2019-10-30 0:16 ` Michael Ellerman
2019-10-30 18:43 ` Kees Cook
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=20191014051320.158682-5-ruscur@russell.cc \
--to=ruscur@russell.cc \
--cc=ajd@linux.ibm.com \
--cc=christophe.leroy@c-s.fr \
--cc=dja@axtens.net \
--cc=joel@jms.id.au \
--cc=kernel-hardening@lists.openwall.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
--cc=npiggin@gmail.com \
/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).