Skip to content

Conversation

smagnani96
Copy link
Contributor

Manual backport of:

With this patch, we protect previous usages of MARK_MAGIC_ENCRYPT which refer only to the IPSec codepath.
In v1.18, we start using that mark to signal also WireGuard encrypted packets, replacing the old MARK_MAGIC_WG_ENCRYPTED that overlaps with the k8s mark space.
This means that v1.17 needs to be able to understand that mark too in the WireGuard codepaths.

Once this PR is merged, a GitHub action will update the labels of these PRs:

 39651

@smagnani96 smagnani96 added kind/backports This PR provides functionality previously merged into master. backport/1.17 This PR represents a backport for Cilium 1.17.x of a PR that was merged to main. labels May 21, 2025
@smagnani96 smagnani96 force-pushed the pr/smagnani96/wg-reuse-ipsec-magic-encrypt-v1.17 branch from 247e889 to b724466 Compare May 21, 2025 11:39
[ upstream commit 294818e ]

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>
This commit adds the minimal logic to v1.17 to handle downgrades from
v1.18, where we started to use the MARK_MAGIC_ENCRYPT also in the
WireGuard codepath to signal encrypted packets post to-wireguard hook.
Therefore, here the ctx_mark_is_wireguard() function should handle that
case. We protected previous usages of that mark in the IPSec codepath,
so here we should be safe.

Signed-off-by: Simone Magnani <simone.magnani@isovalent.com>
@smagnani96 smagnani96 force-pushed the pr/smagnani96/wg-reuse-ipsec-magic-encrypt-v1.17 branch from b724466 to 3d77b7a Compare May 21, 2025 13:10
@smagnani96
Copy link
Contributor Author

/test

@smagnani96 smagnani96 requested a review from pchaigno June 5, 2025 10:14
@smagnani96 smagnani96 self-assigned this Jun 5, 2025
@smagnani96 smagnani96 marked this pull request as ready for review June 5, 2025 10:27
@smagnani96 smagnani96 requested a review from a team as a code owner June 5, 2025 10:27
@smagnani96 smagnani96 requested a review from rgo3 June 5, 2025 10:28
Copy link
Contributor

@rgo3 rgo3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@maintainer-s-little-helper maintainer-s-little-helper bot added the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label Jun 5, 2025
@pchaigno pchaigno added this pull request to the merge queue Jun 6, 2025
Merged via the queue into v1.17 with commit cd96dd2 Jun 6, 2025
455 of 460 checks passed
@pchaigno pchaigno deleted the pr/smagnani96/wg-reuse-ipsec-magic-encrypt-v1.17 branch June 6, 2025 09:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/1.17 This PR represents a backport for Cilium 1.17.x of a PR that was merged to main. kind/backports This PR provides functionality previously merged into master. ready-to-merge This PR has passed all tests and received consensus from code owners to merge.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants