-
Notifications
You must be signed in to change notification settings - Fork 3.4k
bpf:wireguard: reuse MARK_MAGIC_ENCRYPT for encrypted packets #39651
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
Conversation
be3d7fb
to
f6dc8c5
Compare
Going to test this. Given the backport hasn't landed yet, I'd expect all upgrades/downgrades tests to fail, while the other ones should be green. Let's see if this meets my expectations. |
/test |
As expected, all tests are passing except downgrade/upgrade from/to the previous Cilium version, as the backport is not merged yet. |
This commit protects current usages of MARK_MAGIC_ENCRYPT and MARK_MAGIC_DECRYPT for only when IPSec is enabled. This should make sure that in case of further re-using such marks or overlapping marks we do not hit unexpected codepaths. Signed-off-by: Simone Magnani <simone.magnani@isovalent.com>
In previous commits we've protected previous usages of MARK_MAGIC_ENCRYPT in the IPSec codepaths. This means that now we shoudl be able to reuse such mark also in the WireGuard codepaths, to signal already-encrypted packets. This helps us simplifying our mark logic, which sometimes needs to carry 1 bit from the k8s mark space. Hopefully, by protecting all codepaths, we should be able to use only our space. A previous backport to v1.17 has been submitted: in v1.17, we still use MARK_MAGIC_WG_ENCRYPTED. During downgrades from v1.18, we wouldn't be able to tell that a packet marked with MARK_MAGIC_ENCRYPT has been WG-encrypted. With the patch being backported, we should support smooth upgrades/downgrades without disruptions. Signed-off-by: Simone Magnani <simone.magnani@isovalent.com>
f6dc8c5
to
457fc7e
Compare
/test [Backport Done, expecting e2e-upgrade to work] [e2e-upgrade 🟢 passed with no conn disruptions, running again to make sure] [e2e-upgrade 🟢 passed again except an unrelated flake, running again to make sure] [e2e-upgrade 🟢 passed again, marking as ready-for-review] |
By protecting previous usages of MARK_MAGIC_ENCRYPT in the IPSec codepaths, we should be able to reuse such mark also to signal WG-encrypted packets. This allows us to save the bit from the k8s mark space and use our host mask.
A backport patch to v1.17 has been submitted #39652 to be able to recognize WG-encrypted packets in the previous version, which still uses MARK_MAGIC_WG_ENCRYPTED, during downgrades. As soon as it gets merged,
ci-e2e-upgrade
tests should pass.