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

RTC-15334: Fix crash caused by a race condition #397

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

RicardoMDomingues
Copy link
Member

I believe this fix the crash we have seen on compute hmac.

The crash happens to a race condition. STUN packets that are addressed to ProbeServer are being processed on Endpoint jobQueue. If multiple STUN packets arrives in different endpoint (udp ipv4, udp ipv6, tcp ipv4, tcp ipv6) the race can happen on _hmacComputer.

To fix that, ProbeServer now has it's own jobQueue

}
else

if (endpoint.getTransportType() != ice::TransportType::UDP)
Copy link
Member Author

@RicardoMDomingues RicardoMDomingues Jan 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this was another bug. If we received something that was not properly authenticated on UdpEndpoint, we would close UdpEndpoint which is shared port 10000

Copy link
Contributor

@reddvl1980 reddvl1980 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@olofkallander olofkallander left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch. I guess this contention on hmac computer becomes more severe with use of ipv6 and higher traffic.
Most of the time a client will not probe at all before call and if it does, it fires at udp ipv4 before it does tcp v4, if at all. Even if multiple clients probe simultaneously they are serialized over the udp endpoint recvjobqueue. But with ipv6 udp there are two parallell paths.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants