diff --git a/arch/i386/Kconfig.debug b/arch/i386/Kconfig.debug index 6293920cd1be394c32d7161dc05858fedfed6ef3..b31c0802e1ccf53f1e5a677e802c5e34166ebc54 100644 --- a/arch/i386/Kconfig.debug +++ b/arch/i386/Kconfig.debug @@ -49,7 +49,6 @@ config DEBUG_PAGEALLOC 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 diff --git a/arch/i386/mm/init.c b/arch/i386/mm/init.c index b22ce8d6b1ba64c76db039bccdf2920ca9a20061..7135946d366322ade4cb529372f7389647a91d31 100644 --- a/arch/i386/mm/init.c +++ b/arch/i386/mm/init.c @@ -799,6 +799,7 @@ void mark_rodata_ro(void) unsigned long start = PFN_ALIGN(_text); unsigned long size = PFN_ALIGN(_etext) - start; +#ifndef CONFIG_KPROBES #ifdef CONFIG_HOTPLUG_CPU /* It must still be possible to apply SMP alternatives. */ if (num_possible_cpus() <= 1) @@ -808,7 +809,7 @@ void mark_rodata_ro(void) size >> PAGE_SHIFT, PAGE_KERNEL_RX); printk("Write protecting the kernel text: %luk\n", size >> 10); } - +#endif start += size; size = (unsigned long)__end_rodata - start; change_page_attr(virt_to_page(start), diff --git a/arch/x86_64/Kconfig.debug b/arch/x86_64/Kconfig.debug index 8a8677518447ca6624fa0e7b9545772ee6a77959..775d211a5cf93983ca1fd97c64f56fc18c3f8213 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 efb6e845114ec727430860981b03b22495f9d299..9a0e98accf04aae3e11282e3079fd747afa646a3 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;