Skip to content
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

bpf: nat: tolerate non-CT L4 protocols when checking for reply traffic #31820

Merged
merged 1 commit into from Apr 8, 2024

Conversation

julianwiedmann
Copy link
Member

@julianwiedmann julianwiedmann commented Apr 8, 2024

Prior to the blamed commit we ignored any errors from the L4 port extraction, and so traffic that's not supported by CT (eg ESP) would be allowed through. Restore this behaviour by explicitly checking for DROP_CT_UNKNOWN_PROTO.

Fixes: 76217a1 ("bpf: nat: Handle errors from snat_v(4|6)_prepare_state()")
Reported-by: Paul Chaignon paul.chaignon@gmail.com

Avoid drops with "CT: Unknown L4 protocol" for non-ICMP/TCP/UDP traffic, caused by an error check in the BPF NAT engine.

Prior to the blamed commit we ignored any errors from the L4 port
extraction, and so traffic that's not supported by CT (eg ESP) would be
allowed through. Restore this behaviour by explicitly checking for
DROP_CT_UNKNOWN_PROTO.

Fixes: 76217a1 ("bpf: nat: Handle errors from snat_v(4|6)_prepare_state()")
Reported-by: Paul Chaignon <paul.chaignon@gmail.com>
Signed-off-by: Julian Wiedmann <jwi@isovalent.com>
@maintainer-s-little-helper maintainer-s-little-helper bot added the dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. label Apr 8, 2024
@julianwiedmann
Copy link
Member Author

/test

@julianwiedmann julianwiedmann added kind/bug This is a bug in the Cilium logic. kind/regression This functionality worked fine before, but was broken in a newer release of Cilium. needs-backport/1.15 This PR / issue needs backporting to the v1.15 branch labels Apr 8, 2024
@maintainer-s-little-helper maintainer-s-little-helper bot added this to Needs backport from main in 1.15.4 Apr 8, 2024
@julianwiedmann julianwiedmann added the release-note/bug This PR fixes an issue in a previous release of Cilium. label Apr 8, 2024
@maintainer-s-little-helper maintainer-s-little-helper bot removed the dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. label Apr 8, 2024
@julianwiedmann julianwiedmann added feature/conntrack feature/snat Relates to SNAT or Masquerading of traffic labels Apr 8, 2024
@julianwiedmann julianwiedmann marked this pull request as ready for review April 8, 2024 10:01
@julianwiedmann julianwiedmann requested a review from a team as a code owner April 8, 2024 10:01
@julianwiedmann
Copy link
Member Author

(yes, I'll need to polish the release note before merging)

Copy link
Member

@qmonnet qmonnet left a comment

Choose a reason for hiding this comment

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

Looks good, thanks

@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 Apr 8, 2024
@pchaigno pchaigno added this pull request to the merge queue Apr 8, 2024
Merged via the queue into cilium:main with commit 20fbf45 Apr 8, 2024
63 checks passed
@julianwiedmann julianwiedmann deleted the 1.16-bpf-ct-l4 branch April 8, 2024 15:30
@nbusseneau nbusseneau mentioned this pull request Apr 10, 2024
13 tasks
@nbusseneau nbusseneau added backport-pending/1.15 The backport for Cilium 1.15.x for this PR is in progress. and removed needs-backport/1.15 This PR / issue needs backporting to the v1.15 branch labels Apr 10, 2024
@maintainer-s-little-helper maintainer-s-little-helper bot moved this from Needs backport from main to Backport pending to v1.15 in 1.15.4 Apr 10, 2024
@github-actions github-actions bot added backport-done/1.15 The backport for Cilium 1.15.x for this PR is done. and removed backport-pending/1.15 The backport for Cilium 1.15.x for this PR is in progress. labels Apr 11, 2024
@maintainer-s-little-helper maintainer-s-little-helper bot removed this from Backport pending to v1.15 in 1.15.4 Apr 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-done/1.15 The backport for Cilium 1.15.x for this PR is done. feature/conntrack feature/snat Relates to SNAT or Masquerading of traffic kind/bug This is a bug in the Cilium logic. kind/regression This functionality worked fine before, but was broken in a newer release of Cilium. ready-to-merge This PR has passed all tests and received consensus from code owners to merge. release-note/bug This PR fixes an issue in a previous release of Cilium.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants