aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/netdev-times.py
diff options
context:
space:
mode:
authorAndrii Nakryiko <[email protected]>2024-01-19 13:02:01 -0800
committerAlexei Starovoitov <[email protected]>2024-01-23 15:13:47 -0800
commitbc308d011ab8cc61bf1be15a2920bcd7d7b9b9d3 (patch)
tree54d3d250ff01c286ac139a659b9ed24af74b9b46 /tools/perf/scripts/python/netdev-times.py
parentc80c6434aaccc689b2c7ff432d43abad8f4217b2 (diff)
libbpf: call dup2() syscall directly
We've ran into issues with using dup2() API in production setting, where libbpf is linked into large production environment and ends up calling unintended custom implementations of dup2(). These custom implementations don't provide atomic FD replacement guarantees of dup2() syscall, leading to subtle and hard to debug issues. To prevent this in the future and guarantee that no libc implementation will do their own custom non-atomic dup2() implementation, call dup2() syscall directly with syscall(SYS_dup2). Note that some architectures don't seem to provide dup2 and have dup3 instead. Try to detect and pick best syscall. Signed-off-by: Andrii Nakryiko <[email protected]> Acked-by: Song Liu <[email protected]> Acked-by: Yonghong Song <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexei Starovoitov <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/netdev-times.py')
0 files changed, 0 insertions, 0 deletions