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

Fixed SHUTDOWN message with a wrong (uninitialized) DST socket ID #2073

Merged

Conversation

maxsharabayko
Copy link
Collaborator

CUDT::m_PeerID is not initialized by the constructor. It has a random (garbage) value until set during HS.

When a caller with a passphrase tries to connect to a listener without a passphrase, the listener sends a rejection conclusion HS.
The caller, receiving the HS, sees the rejection code (in CUDT::processAsyncConnectRequest(..)), and returns from the function without initializing m_PeerID.
As processAsyncConnectRequest(..) returns false, a SHUTDOWN control packet is sent from CRendezvousQueue::updateConnStatus(..).
But destination SRT socket ID is still not initialized and may contain some garbage value, that could match some existing SRT socket ID on the listener side.
In the worst case, it could lead to a closure of a different valid connection existing on the same port, when SHUTDOWN is sent from the same IP.

@maxsharabayko maxsharabayko added Type: Bug Indicates an unexpected problem or unintended behavior [core] Area: Changes in SRT library core labels Aug 5, 2021
@maxsharabayko maxsharabayko added this to the v1.4.4 milestone Aug 5, 2021
@maxsharabayko maxsharabayko merged commit 0fca874 into Haivision:master Aug 6, 2021
@maxsharabayko maxsharabayko deleted the hotfix/shutdown-dst-sockid branch August 6, 2021 11:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[core] Area: Changes in SRT library core Type: Bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant