You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Crash in srt::CUDT::craftKmResponse from a null pointer in m_pCryptoControl when under some atypical situations
To Reproduce
Very rare crash case, can't be sure how exactly it happened. However the machine where this can be gdb debugged from full core file can remain running for a week to do more debugging in, if needed.
Expected behavior
No crashes
Desktop (please provide the following information):
OS: Fedora 35
SRT Version / commit ID: 1.4.4 from Fedora package
There seem to be a small breach on the listener side processing HS Conclusion Response described below.
// Listener gets incoming conclusion request v5 handshake.intsrt::CUDT::processConnectRequest(..) {
// (...)
CUDT* acpu = NULL;
int result = uglobal().newConnection(.., acpu);
// If an associated socket already exists (seems to be the case according to the backtrace)// returns result = 0 and the existing socket in `acpu`. But `acpu` can be in the Closed state,// meaning m_pCryptoControl is already NULL.// Generate HS response (repeated response on successful connection or rejection reason).// m_pCryptoControl can be NULL, but not checked inside the function.
acpu->craftKmResponse((kmdata), (kmdatasize));
// (..)
}
Places to Fix
In CUDT::craftKmResponse(..) check if m_pCryptoControl is not NULL, otherwise return CONN_REJECT.
If the corresponding connection already exists, the socket is only checked to be broken. But it can be as well closed, having m_pCryptoControl = NULL. (see the code sample below)
intsrt::CUDTUnited::newConnection(.., CUDT*& w_acpu)
{
w_acpu = NULL;
CUDTSocket* ls = locateSocket(listen);
// (..)// Check if this connection already exists.if ((ns = locatePeer(peer, w_hs.m_iID, w_hs.m_iISN)) != NULL)
{
if (ns->core().m_bBroken) // TOFIX: Also check if ns has already been closed!
{
// (..)
}
else
{
// (..)
w_acpu = &ns->core();
return0;
}
}
// (...)
}
Describe the bug
Crash in
srt::CUDT::craftKmResponse
from a null pointer inm_pCryptoControl
when under some atypical situationsTo Reproduce
Very rare crash case, can't be sure how exactly it happened. However the machine where this can be gdb debugged from full core file can remain running for a week to do more debugging in, if needed.
Expected behavior
No crashes
Desktop (please provide the following information):
Additional context
Backtrace:
Initial extra gdb debugging:
The text was updated successfully, but these errors were encountered: