-
Notifications
You must be signed in to change notification settings - Fork 117
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
fix(net): Limit the number of leftover nonces in the self-connection nonce set #6534
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Is there a commit missing here? |
arya2
previously approved these changes
Apr 18, 2023
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #6534 +/- ##
==========================================
+ Coverage 77.68% 77.78% +0.10%
==========================================
Files 305 306 +1
Lines 40104 40236 +132
==========================================
+ Hits 31154 31298 +144
+ Misses 8950 8938 -12 |
* Tests that the number of nonces is limited * removes unused constant * test that it reaches the nonce limit
Thanks for catching that, I forgot to fetch your tests before pushing the branch! |
arya2
approved these changes
Apr 18, 2023
6 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-concurrency
Area: Async code, needs extra work to make it work properly.
A-network
Area: Network protocol updates or fixes
C-bug
Category: This is a bug
C-security
Category: Security issues
I-heavy
Problems with excessive memory, disk, or CPU usage
I-remote-trigger
Remote nodes can make Zebra do something bad
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
This PR prevents a memory exhaustion attack on Zebra.
It also limits the inbound connection rate to make similar attacks harder in future.
Complex Code or Requirements
This PR modifies concurrent network handshake code, where futures run concurrently.
It also adds more code to a futures mutex critical section.
It has already been reviewed privately by two Zebra developers.
Solution
500 or 8 kBthe configured connection limitReview
This is ready for review. It needs to get merged before the next Zebra release.
Reviewer Checklist