diff options
author | Arjan van de Ven <arjan@infradead.org> | 2007-06-21 07:23:21 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-06-22 01:02:50 +0200 |
commit | 0864a4e201b1ea442f4c8b887418a29f67e24d30 (patch) | |
tree | cee5372bb22502e52029543dfb72c571a1e89faa /arch/x86_64 | |
parent | Merge master.kernel.org:/pub/scm/linux/kernel/git/davej/agpgart (diff) | |
download | linux-0864a4e201b1ea442f4c8b887418a29f67e24d30.tar.xz linux-0864a4e201b1ea442f4c8b887418a29f67e24d30.zip |
Allow DEBUG_RODATA and KPROBES to co-exist
Do not mark the kernel text read only if KPROBES is in the kernel;
kprobes needs to hot-patch the kernel text to insert it's
instrumentation.
In this case, only mark the .rodata segment as read only.
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Tested-by: S. P. Prasanna <prasanna@in.ibm.com>
Cc: Andi Kleen <ak@suse.de>
Cc: William Cohen <wcohen@redhat.com>
Cc: Ian McDonald <ian.mcdonald@jandi.co.nz>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/x86_64')
-rw-r--r-- | arch/x86_64/Kconfig.debug | 1 | ||||
-rw-r--r-- | arch/x86_64/mm/init.c | 5 |
2 files changed, 5 insertions, 1 deletions
diff --git a/arch/x86_64/Kconfig.debug b/arch/x86_64/Kconfig.debug index 8a8677518447..775d211a5cf9 100644 --- a/arch/x86_64/Kconfig.debug +++ b/arch/x86_64/Kconfig.debug @@ -9,7 +9,6 @@ source "lib/Kconfig.debug" config DEBUG_RODATA bool "Write protect kernel read-only data structures" depends on DEBUG_KERNEL - depends on !KPROBES # temporary for 2.6.22 help Mark the kernel read-only data as write-protected in the pagetables, in order to catch accidental (and incorrect) writes to such const data. diff --git a/arch/x86_64/mm/init.c b/arch/x86_64/mm/init.c index efb6e845114e..9a0e98accf04 100644 --- a/arch/x86_64/mm/init.c +++ b/arch/x86_64/mm/init.c @@ -605,6 +605,11 @@ void mark_rodata_ro(void) if (num_possible_cpus() > 1) start = (unsigned long)_etext; #endif + +#ifdef CONFIG_KPROBES + start = (unsigned long)__start_rodata; +#endif + end = (unsigned long)__end_rodata; start = (start + PAGE_SIZE - 1) & PAGE_MASK; end &= PAGE_MASK; |