-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
udp_proxy_filter: Fix crash when accepting dynamic cds for UDP. Fixes #34195. #37151
Conversation
Signed-off-by: sinxccc <[email protected]>
Hi @railwaycat, welcome and thank you for your contribution. We will try to review your Pull Request as quickly as possible. In the meantime, please take a look at the contribution guidelines if you have not done so already. |
@railwaycat can you add tests that validate this condition, please? /wait-any |
/assign @yanavlasov |
/wait |
Signed-off-by: sinxccc <[email protected]>
52eddf2
to
7900582
Compare
Hi @yanavlasov Sorry for the delay! I updated the UDP Proxy filter test case |
Is the issue that the cluster_ reference becomes dangling when CDS updates the cluster? If so then this change fixes the problem only partially. There are still uses of the cluster_ reference not related to the cluster info. Lie this:
These will crash as well. Looking at the code, to support dynamic clusters UDP proxy must avoid "capturing" thread local cluster at the filter creation reference and instead lookup the thread local cluster then it is needed and deal with the possibility that it may be not present. Similar to what the router filter does. I understand it is a much bigger change, however this smaller change does not address the underlying cause and may still produce the crash. /wait-any |
This PR fixes the misusing of By the description in this comment envoy/envoy/upstream/cluster_manager.h Line 326 in a0504e8
Before this PR, UDP cluster uses a stored I agree the dangling |
@yanavlasov not familiar with envoy releases, can you tell me which releases will get this fix? |
Commit Message: udp_proxy_filter: Fix crash when accepting dynamic cds for UDP. Fixes #34195.
Additional Description:
Please see #34195 and #26206 for details. This change fixes a usage of cluster info resource after the udp cluster be destroyed.
I've got an approval from envoy-security list for the fix.
Risk Level: Low
Testing: mentioned in both tickets
Docs Changes: N/A
Release Notes:
Platform Specific Features:
[Optional Runtime guard:]
[Optional Fixes #Issue]
[Optional Fixes commit #PR or SHA]
[Optional Deprecated:]
[Optional API Considerations:]