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

Don't allow stateless operations on a binding until fully initialized #1928

Merged
merged 4 commits into from
Aug 19, 2021

Conversation

thhous-msft
Copy link
Contributor

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.

@thhous-msft thhous-msft added the Area: Core Related to the shared, core protocol logic label Aug 19, 2021
@thhous-msft thhous-msft requested a review from a team as a code owner August 19, 2021 02:37
@thhous-msft thhous-msft added the Bug: Core A code bug in the Core MsQuic code label Aug 19, 2021
src/core/binding.c Outdated Show resolved Hide resolved
src/core/binding.c Outdated Show resolved Hide resolved
@thhous-msft thhous-msft merged commit 0fde96e into main Aug 19, 2021
@thhous-msft thhous-msft deleted the thadhouse/statelessopduringinitialize branch August 19, 2021 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Core Related to the shared, core protocol logic Bug: Core A code bug in the Core MsQuic code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants