diff options
author | Vasily Gorbik <gor@linux.ibm.com> | 2022-03-05 15:02:07 +0100 |
---|---|---|
committer | Vasily Gorbik <gor@linux.ibm.com> | 2022-03-27 22:18:39 +0200 |
commit | 09bc20c8fb35cf1afed1612b287e9ddbe6a7d73c (patch) | |
tree | 99638e7ddc2b49eb882d7e2b9476e7c106efc1f3 /arch/s390/kernel | |
parent | 0b452520477efbe4370cb747572c3c63c7cb3176 (diff) | |
download | linux-09bc20c8fb35cf1afed1612b287e9ddbe6a7d73c.tar.gz linux-09bc20c8fb35cf1afed1612b287e9ddbe6a7d73c.tar.bz2 linux-09bc20c8fb35cf1afed1612b287e9ddbe6a7d73c.zip |
s390/kprobes: enable kretprobes framepointer verification
Use regs->gprs[15] for framepointer verification. This enables
additional sanity checks for nested kretprobes.
Reviewed-by: Tobias Huschle <huschle@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Diffstat (limited to 'arch/s390/kernel')
-rw-r--r-- | arch/s390/kernel/kprobes.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/arch/s390/kernel/kprobes.c b/arch/s390/kernel/kprobes.c index e32c14fd1282..0032bdbe8e3f 100644 --- a/arch/s390/kernel/kprobes.c +++ b/arch/s390/kernel/kprobes.c @@ -284,11 +284,11 @@ NOKPROBE_SYMBOL(pop_kprobe); void arch_prepare_kretprobe(struct kretprobe_instance *ri, struct pt_regs *regs) { - ri->ret_addr = (kprobe_opcode_t *) regs->gprs[14]; - ri->fp = NULL; + ri->ret_addr = (kprobe_opcode_t *)regs->gprs[14]; + ri->fp = (void *)regs->gprs[15]; /* Replace the return addr with trampoline addr */ - regs->gprs[14] = (unsigned long) &__kretprobe_trampoline; + regs->gprs[14] = (unsigned long)&__kretprobe_trampoline; } NOKPROBE_SYMBOL(arch_prepare_kretprobe); @@ -385,7 +385,7 @@ NOKPROBE_SYMBOL(arch_kretprobe_fixup_return); */ void trampoline_probe_handler(struct pt_regs *regs) { - kretprobe_trampoline_handler(regs, NULL); + kretprobe_trampoline_handler(regs, (void *)regs->gprs[15]); } NOKPROBE_SYMBOL(trampoline_probe_handler); |