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

portmap: fix bug that new udp connection deletes all existing conntrack entries #705

Merged
merged 1 commit into from Feb 23, 2022

Conversation

devbv
Copy link
Contributor

@devbv devbv commented Feb 19, 2022

Hello, I found a critical bug that new udp connection deletes all existing conntrack entries.
The DeleteConntrackEntriesForDstPort function intended to only delete a conntrack entry that meet the conditions, but calling AddPort before AddProtocol returns an error (Filter attribute not available without a valid Layer 4 protocol: 0) and the port filter remains empty.
As a result, ConntrackDeleteFilter deletes all conntrack entries without port filter.
I think this is the simplest PR to resolve this issue, but I'm totally fine if you just ignore this PR and solve this issue in better way.
Just for reference, this bug is affecting our service with latest AKS node image. I recommend someone who are suffering same issue in AKS to build your own plugin binary and inject to worker nodes.

ref: https://github.com/vishvananda/netlink/blob/main/conntrack_linux.go#L455

@devbv devbv force-pushed the master branch 3 times, most recently from 07bb0e7 to 73d8fde Compare February 19, 2022 05:34
…ck entries

Calling AddPort before AddProtocol returns an error, which means ConntrackDeleteFilter has been called without port filter.

Signed-off-by: Sang Heon Lee <developistBV@gmail.com>
@squeed
Copy link
Member

squeed commented Feb 23, 2022

oof. good catch.
/lgtm
will merge when tests are green.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants