]> git.ipfire.org Git - people/ms/linux.git/commit
bpf: Enable BPF_TRAMP_F_IP_ARG for trampolines with call_get_func_ip
authorJiri Olsa <jolsa@redhat.com>
Wed, 14 Jul 2021 09:43:54 +0000 (11:43 +0200)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 16 Jul 2021 00:16:06 +0000 (17:16 -0700)
commit1e37392cccdea94da635e3c6d16b21865806f619
tree1aae46e49ea79ade58734a32fbb1e9a2386ccbd9
parent7e6f3cd89f04a0a577002d5696288b482109d25c
bpf: Enable BPF_TRAMP_F_IP_ARG for trampolines with call_get_func_ip

Enabling BPF_TRAMP_F_IP_ARG for trampolines that actually need it.

The BPF_TRAMP_F_IP_ARG adds extra 3 instructions to trampoline code
and is used only by programs with bpf_get_func_ip helper, which is
added in following patch and sets call_get_func_ip bit.

This patch ensures that BPF_TRAMP_F_IP_ARG flag is used only for
trampolines that have programs with call_get_func_ip set.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20210714094400.396467-3-jolsa@kernel.org
include/linux/filter.h
kernel/bpf/trampoline.c