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 invalid use of strncat in test_sockmap
strncat()'s third argument is how many bytes will be added *in addition* to already existing bytes in destination. Plus extra zero byte will be added after that. So existing use in test_sockmap has many opportunities to overflow the string and cause memory corruptions. And in this case, GCC complains for a good reason. Fixes: 16962b2 ("bpf: sockmap, add selftests") Fixes: 73563aa ("selftests/bpf: test_sockmap, print additional test options") Fixes: 1ade9ab ("bpf: test_sockmap, add options for msg_pop_data() helper") Fixes: 463bac5 ("bpf, selftests: Add test for ktls with skb bpf ingress policy") Fixes: e9dd904 ("bpf: add tls support for testing in test_sockmap") Fixes: 753fb2e ("bpf: sockmap, add msg_peek tests to test_sockmap") Signed-off-by: Andrii Nakryiko <[email protected]> Signed-off-by: Alexei Starovoitov <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
- Loading branch information