diff options
author | Tejun Heo <tj@kernel.org> | 2010-04-05 04:37:28 +0200 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2010-04-05 04:37:28 +0200 |
commit | 336f5899d287f06d8329e208fc14ce50f7ec9698 (patch) | |
tree | 9b762d450d5eb248a6ff8317badb7e223d93ed58 /arch/arm/kernel/kprobes.c | |
parent | staging/otus: include slab.h from usbdrv.h (diff) | |
parent | Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6 (diff) | |
download | linux-336f5899d287f06d8329e208fc14ce50f7ec9698.tar.xz linux-336f5899d287f06d8329e208fc14ce50f7ec9698.zip |
Merge branch 'master' into export-slabh
Diffstat (limited to 'arch/arm/kernel/kprobes.c')
-rw-r--r-- | arch/arm/kernel/kprobes.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/arch/arm/kernel/kprobes.c b/arch/arm/kernel/kprobes.c index 1fb932b4fece..2ba7deb3072e 100644 --- a/arch/arm/kernel/kprobes.c +++ b/arch/arm/kernel/kprobes.c @@ -394,6 +394,14 @@ void __kprobes jprobe_return(void) /* * Setup an empty pt_regs. Fill SP and PC fields as * they're needed by longjmp_break_handler. + * + * We allocate some slack between the original SP and start of + * our fabricated regs. To be precise we want to have worst case + * covered which is STMFD with all 16 regs so we allocate 2 * + * sizeof(struct_pt_regs)). + * + * This is to prevent any simulated instruction from writing + * over the regs when they are accessing the stack. */ "sub sp, %0, %1 \n\t" "ldr r0, ="__stringify(JPROBE_MAGIC_ADDR)"\n\t" @@ -411,7 +419,7 @@ void __kprobes jprobe_return(void) "ldmia sp, {r0 - pc} \n\t" : : "r" (kcb->jprobe_saved_regs.ARM_sp), - "I" (sizeof(struct pt_regs)), + "I" (sizeof(struct pt_regs) * 2), "J" (offsetof(struct pt_regs, ARM_sp)), "J" (offsetof(struct pt_regs, ARM_pc)), "J" (offsetof(struct pt_regs, ARM_cpsr)) |