summaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/bpf/progs/struct_ops_module.c
diff options
context:
space:
mode:
authorAndrii Nakryiko <andrii@kernel.org>2024-04-28 05:09:53 +0200
committerMartin KaFai Lau <martin.lau@kernel.org>2024-04-30 01:46:06 +0200
commitf973fccd43d34b096077d5d21d051ef75b22a7ea (patch)
tree9cd7d6ace7c93aedc960a429e91ed40d45e8bcf4 /tools/testing/selftests/bpf/progs/struct_ops_module.c
parentbpf: Include linux/types.h for u32 (diff)
downloadlinux-f973fccd43d34b096077d5d21d051ef75b22a7ea.tar.xz
linux-f973fccd43d34b096077d5d21d051ef75b22a7ea.zip
libbpf: handle nulled-out program in struct_ops correctly
If struct_ops has one of program callbacks set declaratively and host kernel is old and doesn't support this callback, libbpf will allow to load such struct_ops as long as that callback was explicitly nulled-out (presumably through skeleton). This is all working correctly, except we won't reset corresponding program slot to NULL before bailing out, which will lead to libbpf not detecting that BPF program has to be not auto-loaded. Fix this by unconditionally resetting corresponding program slot to NULL. Fixes: c911fc61a7ce ("libbpf: Skip zeroed or null fields if not found in the kernel type.") Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Link: https://lore.kernel.org/r/20240428030954.3918764-1-andrii@kernel.org Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
Diffstat (limited to 'tools/testing/selftests/bpf/progs/struct_ops_module.c')
0 files changed, 0 insertions, 0 deletions