diff options
author | Alexei Starovoitov <ast@kernel.org> | 2023-03-17 13:19:18 -0700 |
---|---|---|
committer | Andrii Nakryiko <andrii@kernel.org> | 2023-03-17 15:44:27 -0700 |
commit | 5fc13ad59b60708e52932188854d4d5bf2b0e10e (patch) | |
tree | ee91e7c2bd0e4a922d7e5a0f98f0886f2c9c8eda /kernel/bpf/arraymap.c | |
parent | 58aa2afbb1e61fcf35bfcc819952a3c13d9f9203 (diff) |
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 'kernel/bpf/arraymap.c')
0 files changed, 0 insertions, 0 deletions