diff options
author | Andrii Nakryiko <andrii@kernel.org> | 2024-05-29 15:32:39 -0700 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2024-05-31 20:35:55 -0700 |
commit | 531876c80004ecff7bfdbd8ba6c6b48835ef5e22 (patch) | |
tree | 2155c4d8b9eae681b2ac8081c12d43ce80c7c6e5 /tools/lib/bpf/bpf_tracing.h | |
parent | 3f8fde319524411b96badee3c96f35831300388a (diff) |
libbpf: keep FD_CLOEXEC flag when dup()'ing FD
Make sure to preserve and/or enforce FD_CLOEXEC flag on duped FDs.
Use dup3() with O_CLOEXEC flag for that.
Without this fix libbpf effectively clears FD_CLOEXEC flag on each of BPF
map/prog FD, which is definitely not the right or expected behavior.
Reported-by: Lennart Poettering <lennart@poettering.net>
Fixes: bc308d011ab8 ("libbpf: call dup2() syscall directly")
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Link: https://lore.kernel.org/r/20240529223239.504241-1-andrii@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/lib/bpf/bpf_tracing.h')
0 files changed, 0 insertions, 0 deletions