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
bpf: check bpf_map/bpf_program fd validity #6588
Conversation
Upstream branch: 4c8644f |
f70a701
to
5bbe166
Compare
Upstream branch: 4c8644f |
6aada52
to
d66dbab
Compare
5bbe166
to
068ee27
Compare
Upstream branch: 7f3edd0 |
libbpf creates bpf_program/bpf_map structs for each program/map that user defines, but it allows to disable creating/loading those objects in kernel, in that case they won't have associated file descriptor (fd < 0). Such functionality is used for backward compatibility with some older kernels. Nothing prevents users from passing these maps or programs with no kernel counterpart to libbpf APIs. This change introduces explicit checks for kernel objects existence, aiming to improve visibility of those edge cases and provide meaningful warnings to users. Signed-off-by: Mykyta Yatsenko <yatsenko@meta.com>
d66dbab
to
159a5a5
Compare
068ee27
to
dd3e514
Compare
Upstream branch: 7b30c29 Pull request is NOT updated. Failed to apply https://patchwork.kernel.org/project/netdevbpf/list/?series=836080
conflict:
|
At least one diff in series https://patchwork.kernel.org/project/netdevbpf/list/?series=836080 irrelevant now. Closing PR. |
Pull request for series with
subject: bpf: check bpf_map/bpf_program fd validity
version: 1
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=836080