Skip to content
Commit eceae70b authored by Andrii Nakryiko's avatar Andrii Nakryiko Committed by Alexei Starovoitov
Browse files

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: 16962b24 ("bpf: sockmap, add selftests")
Fixes: 73563aa3 ("selftests/bpf: test_sockmap, print additional test options")
Fixes: 1ade9aba ("bpf: test_sockmap, add options for msg_pop_data() helper")
Fixes: 463bac5f ("bpf, selftests: Add test for ktls with skb bpf ingress policy")
Fixes: e9dd9047 ("bpf: add tls support for testing in test_sockmap")
Fixes: 753fb2ee ("bpf: sockmap, add msg_peek tests to test_sockmap")
Signed-off-by: default avatarAndrii Nakryiko <andrii@kernel.org>
Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20201203235440.2302137-2-andrii@kernel.org
parent 3015b500
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment