net: lwt_bpf: replace name-based BPF program comparison with digest#11982
Open
kernel-patches-daemon-bpf[bot] wants to merge 1 commit intobpf-next_basefrom
Open
net: lwt_bpf: replace name-based BPF program comparison with digest#11982kernel-patches-daemon-bpf[bot] wants to merge 1 commit intobpf-next_basefrom
kernel-patches-daemon-bpf[bot] wants to merge 1 commit intobpf-next_basefrom
Conversation
Author
|
Upstream branch: 9f5b3ff |
6d81208 to
e299921
Compare
Author
|
Upstream branch: 2ca6723 |
9338985 to
e73cc1d
Compare
e299921 to
68b493c
Compare
Author
|
Upstream branch: 2ca6723 |
e73cc1d to
42a6724
Compare
68b493c to
149211d
Compare
bpf_lwt_prog_cmp() used strcmp() on program names as a workaround because delete requests rebuild the LWT state, creating a new bpf_prog instance for the same program. Name comparison is unreliable: programs with the same name but different instructions compare equal, while instruction-identical programs with different names compare unequal. Replace it with a two-step approach: - Pointer equality as a cheap fast path. - SHA256 digest comparison as the fallback. bpf_prog_calc_tag() computes the digest (instructions with map fds zeroed) at the end of bpf_check(), so it is valid for every successfully loaded BPF program. Signed-off-by: Matan Cohen <matan@matanco.space>
Author
|
Upstream branch: 2ca6723 |
42a6724 to
2494cf7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull request for series with
subject: net: lwt_bpf: replace name-based BPF program comparison with digest
version: 1
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=1086467