mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/
synced 2026-10-14 05:55:17 +00:00
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:16962b2404("bpf: sockmap, add selftests") Fixes:73563aa3d9("selftests/bpf: test_sockmap, print additional test options") Fixes:1ade9abadf("bpf: test_sockmap, add options for msg_pop_data() helper") Fixes:463bac5f1c("bpf, selftests: Add test for ktls with skb bpf ingress policy") Fixes:e9dd904708("bpf: add tls support for testing in test_sockmap") Fixes:753fb2ee09("bpf: sockmap, add msg_peek tests to test_sockmap") Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Link: https://lore.kernel.org/bpf/20201203235440.2302137-2-andrii@kernel.org
This commit is contained in:
parent
3015b500ae
commit
eceae70bde
1 changed files with 23 additions and 13 deletions
Loading…
Add table
Add a link
Reference in a new issue