pkg/datapath: require scrub attributes with netkit and endpoint routes#44960
Merged
julianwiedmann merged 1 commit intocilium:mainfrom Mar 25, 2026
Merged
Conversation
Member
Author
|
/test |
9255066 to
2ed24e1
Compare
Member
Author
|
/test |
1 similar comment
|
/test |
Early versions of the netkit driver scrubbed skb metadata before BPF
programs are run, meaning identity metadata is not available in BPF.
This can cause network policy mis-classification if per-endpoint routes
are enabled.
A kernel patch landed in the driver [0] which adds new scrub attributes
to manage this, and a subsequent change was made in the Cilium datapath
connector [1] to make use of these new attributes. However, it's still
possible to run Cilium with netkit on a kernel that doesn't support
them, which is confusing [2] and may still result in strange behavior.
This commit introduces a runtime probe that will actively probe the
underlying host for netkit scrub attributes, if running with per-endpoint
routes. If the probe fails, we error out.
- With bpf.datapathMode={netkit,netkit-l2} this will error and the agent
will fail to start.
- with bpf.datapathMode=auto, this will log a warning and fall-back to
veth connector.
This commit also introduces additional test permutations to cover this.
[0] https://lore.kernel.org/bpf/20241004101335.117711-1-daniel@iogearbox.net
[1] cilium#35306
[2] cilium#40021
Signed-off-by: Alasdair McWilliam <alasdair.mcwilliam@isovalent.com>
2ed24e1 to
a022866
Compare
Member
Author
|
/test |
1 similar comment
|
/test |
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.
Early versions of the netkit driver scrubbed skb metadata before BPF programs are run, meaning identity metadata is not available in BPF. This can cause network policy mis-classification if per-endpoint routes are enabled.
A kernel patch landed in the driver [0] which adds new scrub attributes to manage this, and a subsequent change was made in the Cilium datapath connector [1] to make use of these new attributes. However, it's still possible to run Cilium with netkit on a kernel that doesn't support them, which is confusing [2] and may still result in strange behavior.
This commit introduces a runtime probe that will actively probe the underlying host for netkit scrub attributes, if running with per-endpoint routes. If the probe fails, we error out.
With
bpf.datapathMode={netkit,netkit-l2}this will error and the agent will fail to start.with
bpf.datapathMode=auto, this will log a warning and fall-back to veth connector.This commit also introduces additional test permutations to cover this.
[0] https://lore.kernel.org/bpf/20241004101335.117711-1-daniel@iogearbox.net
[1] #35306
[2] #40021