linux-stable/arch
Jiri Olsa 316cba62df bpf, x64: Allow to use caller address from stack
Currently we call the original function by using the absolute address
given at the JIT generation. That's not usable when having trampoline
attached to multiple functions, or the target address changes dynamically
(in case of live patch). In such cases we need to take the return address
from the stack.

Adding support to retrieve the original function address from the stack
by adding new BPF_TRAMP_F_ORIG_STACK flag for arch_prepare_bpf_trampoline
function.

Basically we take the return address of the 'fentry' call:

   function + 0: call fentry    # stores 'function + 5' address on stack
   function + 5: ...

The 'function + 5' address will be used as the address for the
original function to call.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Signed-off-by: Song Liu <song@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20220720002126.803253-4-song@kernel.org
2022-07-22 22:04:37 +02:00
..
alpha Cleanups (and one fix) around struct mount handling. 2022-06-04 19:00:05 -07:00
arc This set of changes updates init and user mode helper tasks to be 2022-06-03 16:03:05 -07:00
arm Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-07-07 12:07:37 -07:00
arm64 bpf, arm64: Fix compile error in dummy_tramp() 2022-07-22 00:21:16 +02:00
csky This set of changes updates init and user mode helper tasks to be 2022-06-03 16:03:05 -07:00
hexagon
ia64 Bitmap patches for 5.19-rc1 2022-06-04 14:04:27 -07:00
loongarch LoongArch: Make compute_return_era() return void 2022-06-25 18:06:07 +08:00
m68k This set of changes updates init and user mode helper tasks to be 2022-06-03 16:03:05 -07:00
microblaze This set of changes updates init and user mode helper tasks to be 2022-06-03 16:03:05 -07:00
mips mips: lantiq: Add missing of_node_put() in irq.c 2022-06-21 22:34:03 +02:00
nios2 This set of changes updates init and user mode helper tasks to be 2022-06-03 16:03:05 -07:00
openrisc openrisc: unwinder: Fix grammar issue in comment 2022-06-28 17:31:24 +09:00
parisc parisc: Fix vDSO signal breakage on 32-bit kernel 2022-07-02 18:36:58 +02:00
powerpc powerpc/memhotplug: Add add_pages override for PPC 2022-06-29 20:43:16 +10:00
riscv Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-06-30 16:31:00 -07:00
s390 s390/qdio: Fix spelling mistake 2022-06-30 19:40:36 +02:00
sh This set of changes updates init and user mode helper tasks to be 2022-06-03 16:03:05 -07:00
sparc This set of changes updates init and user mode helper tasks to be 2022-06-03 16:03:05 -07:00
um um: virt-pci: set device ready in probe() 2022-06-10 20:38:06 -04:00
x86 bpf, x64: Allow to use caller address from stack 2022-07-22 22:04:37 +02:00
xtensa xtensa: change '.bss' to '.section .bss' 2022-06-20 02:50:34 -07:00
.gitignore
Kconfig A set of objtool fixes: 2022-06-05 09:45:27 -07:00