Skip to content
Commit 8e50750f authored by Marco Vedovati's avatar Marco Vedovati Committed by Daniel Borkmann
Browse files

libbpf: Set close-on-exec flag on gzopen



Enable the close-on-exec flag when using gzopen. This is especially important
for multithreaded programs making use of libbpf, where a fork + exec could
race with libbpf library calls, potentially resulting in a file descriptor
leaked to the new process. This got missed in 59842c54 ("libbpf: Ensure
libbpf always opens files with O_CLOEXEC").

Fixes: 59842c54 ("libbpf: Ensure libbpf always opens files with O_CLOEXEC")
Signed-off-by: default avatarMarco Vedovati <marco.vedovati@crowdstrike.com>
Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20230810214350.106301-1-martin.kelly@crowdstrike.com
parent 6da4fea8
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment