linux/arch/x86
Mathieu Desnoyers 15a601eb9c x86: fix test_poke for vmalloced pages
* Ingo Molnar (mingo@elte.hu) wrote:
>
> * Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca> wrote:
>
> > The shadow vmap for DEBUG_RODATA kernel text modification uses
> > virt_to_page to get the pages from the pointer address.
> >
> > However, I think vmalloc_to_page would be required in case the page is
> > used for modules.
> >
> > Since only the core kernel text is marked read-only, use
> > kernel_text_address() to make sure we only shadow map the core kernel
> > text, not modules.
>
> actually, i think we should mark module text readonly too.
>

Yes, but in the meantime, the x86 tree would need this patch to make
kprobes work correctly on modules.

I suspect that without this fix, with the enhanced hotplug and kprobes
patch, kprobes will use text_poke to insert breakpoints in modules
(vmalloced pages used), which will map the wrong pages and corrupt
random kernel locations instead of updating the correct page.

Work that would write protect the module pages should clearly be done,
but it can come in a later time. We have to make sure we interact
correctly with the page allocation debugging, as an example.

Here is the patch against x86.git 2.6.25-rc5 :

The shadow vmap for DEBUG_RODATA kernel text modification uses virt_to_page to
get the pages from the pointer address.

However, I think vmalloc_to_page would be required in case the page is used for
modules.

Since only the core kernel text is marked read-only, use kernel_text_address()
to make sure we only shadow map the core kernel text, not modules.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
CC: akpm@linux-foundation.org
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:41:29 +02:00
..
boot x86: coding style fixes to arch/x86/boot/cpucheck.c 2008-04-17 17:40:50 +02:00
configs x86, core: remove CONFIG_FORCED_INLINING 2008-02-09 23:24:09 +01:00
crypto [CRYPTO] twofish: Merge common glue code 2008-01-14 17:07:57 +11:00
ia32 x86: sys32_execve PT_DTRACE 2008-04-17 17:41:13 +02:00
kernel x86: fix test_poke for vmalloced pages 2008-04-17 17:41:29 +02:00
kvm KVM: MMU: Fix memory leak on guest demand faults 2008-03-25 10:22:17 +02:00
lguest x86: replace remaining __FUNCTION__ occurances 2008-04-17 17:40:57 +02:00
lib x86: coding style fixes to arch/x86/lib/usercopy_32.c 2008-04-17 17:40:51 +02:00
mach-default spelling fixes: arch/i386/ 2007-10-20 01:13:56 +02:00
mach-es7000 i386: es7000 minor cleanups 2007-10-17 20:16:15 +02:00
mach-generic x86: coding style fixes to arch/x86/mach-generic/bigsmp.c 2008-04-17 17:40:48 +02:00
mach-rdc321x x86, rdc321x: remove watchdog file 2008-04-17 17:40:50 +02:00
mach-visws x86/visws: fix printk format warnings 2008-03-21 17:06:15 +01:00
mach-voyager x86: move stack_start to smp.h 2008-04-17 17:41:02 +02:00
math-emu i386: arch/x86/math-emu/reg_ld_str.c: fix warning 2008-04-17 17:41:21 +02:00
mm x86: fix memtest print out 2008-04-17 17:41:21 +02:00
oprofile x86: coding style fixes to arch/x86/oprofile/nmi_timer_int.c 2008-04-17 17:40:50 +02:00
pci x86: PAT bug fix for attribute type check after reserve_memtype 2008-04-17 17:41:20 +02:00
power x86: coding style fixes to arch/x86/power/cpu_32.c 2008-04-17 17:40:50 +02:00
vdso x86: include mach_apic.h in smpboot_64.c and smpboot.c 2008-04-17 17:41:02 +02:00
video
xen xen: use iret instruction all the time 2008-04-17 17:40:51 +02:00
Kconfig x86: memtest bootparam 2008-04-17 17:41:21 +02:00
Kconfig.cpu x86: a P4 is a P6 not an i486 2008-03-04 11:55:34 -08:00
Kconfig.debug x86: add gbpages switches 2008-04-17 17:40:45 +02:00
Makefile x86: add subarch support (for headers) to x86_64 2008-04-17 17:41:01 +02:00
Makefile_32.cpu x86: move i386 and x86_64 Makefiles to arch/x86 2007-10-25 22:27:34 +02:00