diff options
author | Jiri Olsa <jolsa@kernel.org> | 2022-09-26 18:33:38 +0300 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2022-09-27 06:30:39 +0300 |
commit | c09eb2e578eb1668bbc84dc07e8d8bd6f04b9a02 (patch) | |
tree | 9973e5887e6c902a44b5bf096a775a8ffd372ab2 /include/uapi/linux/bpf.h | |
parent | 4d854f4f31ec4b317dfe316111ddac0fab81f735 (diff) | |
download | linux-c09eb2e578eb1668bbc84dc07e8d8bd6f04b9a02.tar.xz |
bpf: Adjust kprobe_multi entry_ip for CONFIG_X86_KERNEL_IBT
Martynas reported bpf_get_func_ip returning +4 address when
CONFIG_X86_KERNEL_IBT option is enabled.
When CONFIG_X86_KERNEL_IBT is enabled we'll have endbr instruction
at the function entry, which screws return value of bpf_get_func_ip()
helper that should return the function address.
There's short term workaround for kprobe_multi bpf program made by
Alexei [1], but we need this fixup also for bpf_get_attach_cookie,
that returns cookie based on the entry_ip value.
Moving the fixup in the fprobe handler, so both bpf_get_func_ip
and bpf_get_attach_cookie get expected function address when
CONFIG_X86_KERNEL_IBT option is enabled.
Also renaming kprobe_multi_link_handler entry_ip argument to fentry_ip
so it's clearer this is an ftrace __fentry__ ip.
[1] commit 7f0059b58f02 ("selftests/bpf: Fix kprobe_multi test.")
Cc: Peter Zijlstra <peterz@infradead.org>
Reported-by: Martynas Pumputis <m@lambda.lt>
Acked-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Link: https://lore.kernel.org/r/20220926153340.1621984-5-jolsa@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'include/uapi/linux/bpf.h')
0 files changed, 0 insertions, 0 deletions