Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
selftests/bpf: Fix multiple segfaults in bpf_tcp_ca
Several test cases create a bpf_link from a struct_ops but attempt to use it without first error-checking. This results is segfaults if the arch does not yet support BPF struct_ops (e.g. mips64el): # ./test_progs -n 29/9 test_update_ca:PASS:open 0 nsec test_update_ca:FAIL:attach_struct_ops unexpected error: -524 do_test:PASS:socket 0 nsec do_test:PASS:socket 0 nsec settcpca:FAIL:setsockopt unexpected setsockopt: actual -1 == expected -1 test_update_ca:FAIL:ca1_ca1_cnt unexpected ca1_ca1_cnt: actual 0 <= expected 0 torvalds#29/9 bpf_tcp_ca/update_ca:FAIL torvalds#29 bpf_tcp_ca:FAIL Caught signal torvalds#11! Stack trace: <backtrace not supported> [17900.243360] do_page_fault(): sending SIGSEGV to test_progs for invalid read access from 0000000000000020 [17900.243799] epc = 00000001204f817c in test_progs[4f817c,120000000+c53000] [17900.244209] ra = 00000001204f8108 in test_progs[4f8108,120000000+c53000] Segmentation fault Add the missing error handling to allow these tests to fail gracefully. Fixes: 06da9f3 ("selftests/bpf: Test switching TCP Congestion Control algorithms") Signed-off-by: Tony Ambardar <tony.ambardar@gmail.com>
- Loading branch information