diff options
author | Martin KaFai Lau <[email protected]> | 2020-03-13 18:02:09 -0700 |
---|---|---|
committer | Daniel Borkmann <[email protected]> | 2020-03-17 20:40:19 +0100 |
commit | 8e7ae2518f5265f0ef09d561748098fde5a87ccd (patch) | |
tree | 4ca18ed93fa3e56a4c81ff6715d0a8b9d8b7afb9 /tools/perf/util/scripting-engines | |
parent | 32ca98feab8c9076c89c0697c5a85e46fece809d (diff) |
bpf: Sanitize the bpf_struct_ops tcp-cc name
The bpf_struct_ops tcp-cc name should be sanitized in order to
avoid problematic chars (e.g. whitespaces).
This patch reuses the bpf_obj_name_cpy() for accepting the same set
of characters in order to keep a consistent bpf programming experience.
A "size" param is added. Also, the strlen is returned on success so
that the caller (like the bpf_tcp_ca here) can error out on empty name.
The existing callers of the bpf_obj_name_cpy() only need to change the
testing statement to "if (err < 0)". For all these existing callers,
the err will be overwritten later, so no extra change is needed
for the new strlen return value.
v3:
- reverse xmas tree style
v2:
- Save the orig_src to avoid "end - size" (Andrii)
Fixes: 0baf26b0fcd7 ("bpf: tcp: Support tcp_congestion_ops in bpf")
Signed-off-by: Martin KaFai Lau <[email protected]>
Signed-off-by: Daniel Borkmann <[email protected]>
Acked-by: Andrii Nakryiko <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
Diffstat (limited to 'tools/perf/util/scripting-engines')
0 files changed, 0 insertions, 0 deletions