diff options
author | Yonghong Song <yhs@fb.com> | 2023-05-02 11:05:43 -0700 |
---|---|---|
committer | Andrii Nakryiko <andrii@kernel.org> | 2023-05-02 16:19:06 -0700 |
commit | bf6882aebd0ea67558764d44ddeffc7d253c6eb8 (patch) | |
tree | e843ea0a3518abe191b3ddf3325f57b0f4c1ffe6 /kernel/bpf/syscall.c | |
parent | 577c34b3be6e55ade4e0391022b9a539b20d77c5 (diff) |
bpf: Emit struct bpf_tcp_sock type in vmlinux BTF
In one of our internal testing, we found a case where
- uapi struct bpf_tcp_sock is in vmlinux.h where vmlinux.h is not
generated from the testing kernel
- struct bpf_tcp_sock is not in vmlinux BTF
The above combination caused bpf load failure as the following
memory access
struct bpf_tcp_sock *tcp_sock = ...;
... tcp_sock->snd_cwnd ...
needs CORE relocation but the relocation cannot be resolved since
the kernel BTF does not have corresponding type.
Similar to other previous cases (nf_conn___init, tcp6_sock, mctcp_sock, etc.),
add the type to vmlinux BTF with BTF_EMIT_TYPE macro.
Signed-off-by: Yonghong Song <yhs@fb.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20230502180543.1832140-1-yhs@fb.com
Diffstat (limited to 'kernel/bpf/syscall.c')
0 files changed, 0 insertions, 0 deletions