From: Michael Ellerman <mpe@ellerman.id.au>
To: linuxppc-dev@ozlabs.org
Subject: [PATCH v6 10/10] powerpc/Kconfig: Enable STRICT_KERNEL_RWX for some configs
Date: Mon, 3 Jul 2017 23:01:54 +1000 [thread overview]
Message-ID: <1499086914-25695-10-git-send-email-mpe@ellerman.id.au> (raw)
In-Reply-To: <1499086914-25695-1-git-send-email-mpe@ellerman.id.au>
From: Balbir Singh <bsingharora@gmail.com>
All code that patches kernel text has been moved over to using
patch_instruction() and patch_instruction() is able to cope with the
kernel text being read only.
The linker script has been updated to ensure the read only data ends
on a large page boundary, so it and the preceding kernel text can be
marked R_X. We also have implementations of mark_rodata_ro() for Hash
and Radix MMU modes.
There are some corner-cases missing when the kernel is built
relocatable, so for now make it depend on !RELOCATABLE.
There's also a temporary workaround to depend on !HIBERNATION to avoid
a build failure, that will be removed once we've merged with the PM
tree.
Signed-off-by: Balbir Singh <bsingharora@gmail.com>
[mpe: Make it depend on !RELOCATABLE, munge change log]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
arch/powerpc/Kconfig | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index eb0e591c867d..0190340f8ca9 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -164,6 +164,8 @@ config PPC
select HAVE_ARCH_MMAP_RND_COMPAT_BITS if COMPAT
select HAVE_ARCH_SECCOMP_FILTER
select HAVE_ARCH_TRACEHOOK
+ select ARCH_HAS_STRICT_KERNEL_RWX if (PPC_BOOK3S_64 && !RELOCATABLE && !HIBERNATION)
+ select ARCH_OPTIONAL_KERNEL_RWX if ARCH_HAS_STRICT_KERNEL_RWX
select HAVE_CBPF_JIT if !PPC64
select HAVE_CONTEXT_TRACKING if PPC64
select HAVE_DEBUG_KMEMLEAK
--
2.7.4
next prev parent reply other threads:[~2017-07-03 13:02 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-03 13:01 [PATCH v6 01/10] powerpc/pseries: Fix passing of pp0 in updatepp() and updateboltedpp() Michael Ellerman
2017-07-03 13:01 ` [PATCH v6 02/10] powerpc/mm/radix: Fix execute permissions for interrupt_vectors Michael Ellerman
2017-07-03 13:01 ` [PATCH v6 03/10] powerpc/kprobes: Move kprobes over to patch_instruction() Michael Ellerman
2017-07-03 13:01 ` [PATCH v6 04/10] powerpc/kprobes/optprobes: Use patch_instruction() Michael Ellerman
2017-07-03 13:01 ` [PATCH v6 05/10] powerpc/xmon: Add patch_instruction() support for xmon Michael Ellerman
2017-07-03 13:01 ` [PATCH v6 06/10] powerpc/lib/code-patching: Use alternate map for patch_instruction() Michael Ellerman
2017-11-23 7:12 ` Christophe LEROY
2017-11-23 11:04 ` Michael Ellerman
2017-07-03 13:01 ` [PATCH v6 07/10] powerpc/vmlinux.lds: Align __init_begin to 16M Michael Ellerman
2017-07-03 13:01 ` [PATCH v6 08/10] powerpc/mm/hash: Implement mark_rodata_ro() for hash Michael Ellerman
2017-07-03 13:01 ` [PATCH v6 09/10] powerpc/mm/radix: Implement STRICT_RWX/mark_rodata_ro() for Radix Michael Ellerman
2017-07-03 13:01 ` Michael Ellerman [this message]
2017-07-04 10:48 ` [v6, 01/10] powerpc/pseries: Fix passing of pp0 in updatepp() and updateboltedpp() Michael Ellerman
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=1499086914-25695-10-git-send-email-mpe@ellerman.id.au \
--to=mpe@ellerman.id.au \
--cc=linuxppc-dev@ozlabs.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).