diff options
author | Kui-Feng Lee <thinker.li@gmail.com> | 2024-04-04 16:23:42 -0700 |
---|---|---|
committer | Andrii Nakryiko <andrii@kernel.org> | 2024-04-05 10:33:18 -0700 |
commit | ba0cbe2bb4ab8aa266e48c6399bebf6e1217828a (patch) | |
tree | 318c36052520f655e96c0b6391e27c75b3be39f1 /tools/testing/selftests/bpf/prog_tests/verifier.c | |
parent | 270954791c706b133a03b01e4b2d063dc870f704 (diff) |
selftests/bpf: Make sure libbpf doesn't enforce the signature of a func pointer.
The verifier in the kernel ensures that the struct_ops operators behave
correctly by checking that they access parameters and context
appropriately. The verifier will approve a program as long as it correctly
accesses the context/parameters, regardless of its function signature. In
contrast, libbpf should not verify the signature of function pointers and
functions to enable flexibility in loading various implementations of an
operator even if the signature of the function pointer does not match those
in the implementations or the kernel.
With this flexibility, user space applications can adapt to different
kernel versions by loading a specific implementation of an operator based
on feature detection.
This is a follow-up of the commit c911fc61a7ce ("libbpf: Skip zeroed or
null fields if not found in the kernel type.")
Signed-off-by: Kui-Feng Lee <thinker.li@gmail.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20240404232342.991414-1-thinker.li@gmail.com
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/verifier.c')
0 files changed, 0 insertions, 0 deletions