Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libbpf: keep FD_CLOEXEC flag when dup()'ing FD #7117

Closed

Conversation

kernel-patches-daemon-bpf[bot]
Copy link

Pull request for series with
subject: libbpf: keep FD_CLOEXEC flag when dup()'ing FD
version: 1
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=857152

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: fbe3e84
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=857152
version: 1

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: f088cab
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=857152
version: 1

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 46253c4
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=857152
version: 1

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: bc308d0 ("libbpf: call dup2() syscall directly")
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Jiri Olsa <jolsa@kernel.org>
@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 3f8fde3
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=857152
version: 1

@kernel-patches-daemon-bpf
Copy link
Author

At least one diff in series https://patchwork.kernel.org/project/netdevbpf/list/?series=857152 irrelevant now. Closing PR.

@kernel-patches-daemon-bpf kernel-patches-daemon-bpf bot deleted the series/857152=>bpf-next branch June 1, 2024 03:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant