-
Notifications
You must be signed in to change notification settings - Fork 5
bpftool: fix a bug in subskeleton code generation #179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Master branch: 9492450 |
Master branch: a8fee96 |
57c2167
to
9f881bd
Compare
Master branch: 46e9244 |
9f881bd
to
676f41c
Compare
Master branch: ef07860 |
676f41c
to
deb70db
Compare
Master branch: 7ada378 |
deb70db
to
73f237d
Compare
Master branch: ec80906 |
73f237d
to
6a73ccd
Compare
Master branch: f709869 |
6a73ccd
to
7bdddbf
Compare
Master branch: d0f325c |
7bdddbf
to
7f18193
Compare
Master branch: d8dc09a |
7f18193
to
0703f68
Compare
Master branch: d56c9fe |
0703f68
to
34a2095
Compare
Master branch: e581094 |
Compiled with clang by adding LLVM=1 both kernel and selftests/bpf build, I hit the following compilation error: In file included from /.../tools/testing/selftests/bpf/prog_tests/subskeleton.c:6: ./test_subskeleton_lib.subskel.h:168:6: error: variable 'err' is used uninitialized whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized] if (!s->progs) ^~~~~~~~~ ./test_subskeleton_lib.subskel.h:181:11: note: uninitialized use occurs here errno = -err; ^~~ ./test_subskeleton_lib.subskel.h:168:2: note: remove the 'if' if its condition is always false if (!s->progs) ^~~~~~~~~~~~~~ The compilation error is triggered by the following code ... int err; obj = (struct test_subskeleton_lib *)calloc(1, sizeof(*obj)); if (!obj) { errno = ENOMEM; goto err; } ... err: test_subskeleton_lib__destroy(obj); errno = -err; ... in test_subskeleton_lib__open(). The 'err' is not initialized, yet it is used in 'errno = -err' later. The fix is to remove 'errno = -err' since errno has been set properly in all incoming branches. Cc: Delyan Kratunov <[email protected]> Fixes: 00389c5 ("00389c58ffe993782a8ba4bb5a34a102b1f6fe24") Signed-off-by: Yonghong Song <[email protected]>
34a2095
to
8d966ad
Compare
At least one diff in series https://patchwork.kernel.org/project/netdevbpf/list/?series=624920 irrelevant now. Closing PR. |
Add a big batch of selftest to extend test_progs with various tc link, attach ops and old-style tc BPF attachments via libbpf APIs. Also test multi-program attachments including mixing the various attach options: # ./test_progs -t tc_link #179 tc_link_base:OK #180 tc_link_detach:OK #181 tc_link_mix:OK #182 tc_link_opts:OK #183 tc_link_run_base:OK #184 tc_link_run_chain:OK Summary: 6/0 PASSED, 0 SKIPPED, 0 FAILED All new and existing test cases pass. Co-developed-by: Nikolay Aleksandrov <[email protected]> Signed-off-by: Nikolay Aleksandrov <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]>
Pull request for series with
subject: bpftool: fix a bug in subskeleton code generation
version: 1
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=624920