linux/arch
Naveen N. Rao 2dea1d9c38 powerpc/uprobes: Implement arch_uretprobe_is_alive()
This helper is used to detect if a uprobe'd function has returned
through a setjmp/longjmp, rather than branching to the LR that was
updated previously by us. This fixes a SIGSEGV that gets generated when
programs use setjmp/longjmp with uretprobes.

We use the arm64 model (arch/arm64/kernel/probes/uprobes.c:
arch_uretprobe_is_alive()) for detecting when stack frames have been
removed from under us.

Reference:
https://marc.info/?l=linux-kernel&m=143748610330073
commit 7b868e4802 ("uprobes/x86: Reimplement arch_uretprobe_is_alive()")
commit db087ef69a ("uprobes/x86: Make arch_uretprobe_is_alive(RP_CHECK_CALL) more
clever")

Tested with the test program from:
https://sourceware.org/git/gitweb.cgi?p=systemtap.git;a=blob;f=testsuite/systemtap.base/bz5274.c;hb=HEAD

And this script:
    $ cat test.sh
    #!/bin/bash

    perf probe -x ./bz5274 -a bz5274_main_return=main%return
    perf probe -x ./bz5274 -a bz5274_funca_return=funca%return
    perf probe -x ./bz5274 -a bz5274_funcb_return=funcb%return
    perf probe -x ./bz5274 -a bz5274_funcc_return=funcc%return
    perf probe -x ./bz5274 -a bz5274_funcd_return=funcd%return

    perf record -e 'probe_bz5274:*' -aR ./bz5274

Reported-by: Gustavo Luiz Duarte <gduarte@redhat.com>
Reported-by: zsun@redhat.com
Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Acked-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
2017-08-24 16:19:21 +10:00
..
alpha tty: Fix TIOCGPTPEER ioctl definition 2017-07-17 17:04:41 +02:00
arc arc: move generic-y of exported headers to uapi/asm/Kbuild 2017-07-10 03:43:21 +09:00
arm Merge branch 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2017-07-21 10:41:19 -07:00
arm64 Merge branch 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2017-07-21 10:41:19 -07:00
blackfin Merge branch 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2017-07-21 10:41:19 -07:00
c6x Merge branch 'work.uaccess-unaligned' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2017-07-15 11:17:52 -07:00
cris Kbuild updates for v4.13 (2nd) 2017-07-13 13:37:57 -07:00
frv FRV: tlbflush: move asmlinkage before return type 2017-07-12 16:26:04 -07:00
h8300 h8300: Add missing closing parenthesis in flat_get_addr_from_rp() 2017-07-16 09:24:06 -07:00
hexagon hexagon: move generic-y of exported headers to uapi/asm/Kbuild 2017-07-10 03:43:26 +09:00
ia64 Merge branch 'work.uaccess-unaligned' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2017-07-15 11:17:52 -07:00
m32r Merge branch 'work.uaccess-unaligned' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2017-07-15 11:17:52 -07:00
m68k blackfin, m68k: Fix flat_set_persistent() for unsigned long to u32 changes 2017-07-16 09:24:06 -07:00
metag metag: move generic-y of exported headers to uapi/asm/Kbuild 2017-07-10 03:43:30 +09:00
microblaze Merge branch 'work.uaccess-unaligned' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2017-07-15 11:17:52 -07:00
mips tty: Fix TIOCGPTPEER ioctl definition 2017-07-17 17:04:41 +02:00
mn10300 Merge branch 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2017-07-21 10:41:19 -07:00
nios2 nios2: move generic-y of exported headers to uapi/asm/Kbuild 2017-07-11 21:33:43 +09:00
openrisc openrisc: move generic-y of exported headers to uapi/asm/Kbuild 2017-07-11 21:33:50 +09:00
parisc TTY/Serial fixes for 4.13-rc2 2017-07-22 09:00:24 -07:00
powerpc powerpc/uprobes: Implement arch_uretprobe_is_alive() 2017-08-24 16:19:21 +10:00
s390 Merge branch 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2017-07-21 10:41:19 -07:00
score Merge branch 'uaccess.strlen' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2017-07-06 22:07:44 -07:00
sh TTY/Serial fixes for 4.13-rc2 2017-07-22 09:00:24 -07:00
sparc TTY/Serial fixes for 4.13-rc2 2017-07-22 09:00:24 -07:00
tile Merge branch 'work.uaccess-unaligned' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2017-07-15 11:17:52 -07:00
um Merge branch 'for-linus-4.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml 2017-07-15 10:49:33 -07:00
unicore32 unicore32: move generic-y of exported headers to uapi/asm/Kbuild 2017-07-11 21:33:52 +09:00
x86 xen/x86: fix cpu hotplug 2017-07-23 08:13:11 +02:00
xtensa tty: Fix TIOCGPTPEER ioctl definition 2017-07-17 17:04:41 +02:00
.gitignore
Kconfig include/linux/string.h: add the option of fortified string.h functions 2017-07-12 16:26:03 -07:00