diff options
author | 2023-03-17 13:19:18 -0700 | |
---|---|---|
committer | 2023-03-17 15:44:27 -0700 | |
commit | 5fc13ad59b60708e52932188854d4d5bf2b0e10e (patch) | |
tree | ee91e7c2bd0e4a922d7e5a0f98f0886f2c9c8eda /tools/lib/bpf/bpf_helpers.h | |
parent | bpf: Allow ld_imm64 instruction to point to kfunc. (diff) | |
download | wireguard-linux-5fc13ad59b60708e52932188854d4d5bf2b0e10e.tar.xz wireguard-linux-5fc13ad59b60708e52932188854d4d5bf2b0e10e.zip |
libbpf: Fix relocation of kfunc ksym in ld_imm64 insn.
void *p = kfunc; -> generates ld_imm64 insn.
kfunc() -> generates bpf_call insn.
libbpf patches bpf_call insn correctly while only btf_id part of ld_imm64 is
set in the former case. Which means that pointers to kfuncs in modules are not
patched correctly and the verifier rejects load of such programs due to btf_id
being out of range. Fix libbpf to patch ld_imm64 for kfunc.
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20230317201920.62030-3-alexei.starovoitov@gmail.com
Diffstat (limited to 'tools/lib/bpf/bpf_helpers.h')
0 files changed, 0 insertions, 0 deletions