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: handle nulled-out program in struct_ops correctly #6901
Conversation
Upstream branch: 6e25bcf |
1c660c9
to
c70be35
Compare
Upstream branch: 07801a2 |
df44431
to
4a35438
Compare
c70be35
to
d6c3e7a
Compare
Upstream branch: 89de2db |
4a35438
to
6c14d0b
Compare
d6c3e7a
to
bc37608
Compare
Upstream branch: 0db63c0 |
6c14d0b
to
58f4381
Compare
bc37608
to
db2a39d
Compare
Upstream branch: cb01621 |
58f4381
to
d6bf7c8
Compare
db2a39d
to
19fa8c7
Compare
Upstream branch: 789d9a5 |
d6bf7c8
to
89c4b0a
Compare
19fa8c7
to
70e11c5
Compare
If struct_ops has one of program callbacks set declaratively and host kernel is old and doesn't support this callback, libbpf will allow to load such struct_ops as long as that callback was explicitly nulled-out (presumably through skeleton). This is all working correctly, except we won't reset corresponding program slot to NULL before bailing out, which will lead to libbpf not detecting that BPF program has to be not auto-loaded. Fix this by unconditionally resetting corresponding program slot to NULL. Fixes: c911fc6 ("libbpf: Skip zeroed or null fields if not found in the kernel type.") Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
…erly Add a selftests validating that it's possible to have some struct_ops callback set declaratively, then disable it (by setting to NULL) programmatically. Libbpf should detect that such program should be loaded, even if host kernel doesn't have type information for it. Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Upstream branch: cfd3bfe |
89c4b0a
to
6c6cd9e
Compare
70e11c5
to
20138b5
Compare
At least one diff in series https://patchwork.kernel.org/project/netdevbpf/list/?series=848574 irrelevant now. Closing PR. |
Pull request for series with
subject: libbpf: handle nulled-out program in struct_ops correctly
version: 1
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=848574