Don't allow stateless operations on a binding until fully initialized #1928
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.
A small race condition exists if a server binding is created and runs out of memory at a specific point in the process. If the socket and at least 1 receive buffer gets allocated, a packet can be received on that receive queue. This receive can post a stateless operation, even if one of the later receive buffers fails to allocate, and cause the socket and binding to be cleaned up early. During binding cleanup, there will be a stateless operation in the binding queue, causing an assertion to be hit.
The solution to this is to not allow a stateless operation to queue until the binding has been fully initialized. The packet will be dropped instead, which is fine.