diff options
| author | Alexei Starovoitov <[email protected]> | 2023-03-17 20:19:18 +0000 |
|---|---|---|
| committer | Andrii Nakryiko <[email protected]> | 2023-03-17 22:44:27 +0000 |
| commit | 5fc13ad59b60708e52932188854d4d5bf2b0e10e (patch) | |
| tree | ee91e7c2bd0e4a922d7e5a0f98f0886f2c9c8eda /tools/lib/bpf/bpf_helpers.h | |
| parent | bpf: Allow ld_imm64 instruction to point to kfunc. (diff) | |
| download | kernel-5fc13ad59b60708e52932188854d4d5bf2b0e10e.tar.gz kernel-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 <[email protected]>
Signed-off-by: Andrii Nakryiko <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
Diffstat (limited to 'tools/lib/bpf/bpf_helpers.h')
0 files changed, 0 insertions, 0 deletions
