-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
exchange leak in DeviceCommissioner::EstablishPASEConnection #13422
Comments
msandstedt
added a commit
to msandstedt/connectedhomeip
that referenced
this issue
Jan 10, 2022
This requires that we allocate the exchanges right before calling PASESesion::Pair / CASESession::EstablishSession. An equivalent problem is reported in project-chip#13422 for similar code in CHIPDeviceController.cpp.
Confirmed this bug also exists for CASE:
If |
msandstedt
added a commit
to msandstedt/connectedhomeip
that referenced
this issue
Jan 27, 2022
This requires that we allocate the exchanges right before calling PASESesion::Pair / CASESession::EstablishSession. An equivalent problem is reported in project-chip#13422 for similar code in CHIPDeviceController.cpp.
msandstedt
added a commit
that referenced
this issue
Jan 28, 2022
The CASESession and PASESession objects take ownership of their exchange contexts once passed, and will free and / or close them as appropriate. However, for this object lifecycle management to occur, exchange contexts must be passed to these objects in the first place. The current session establishment calls do not do this if early-out failures occur between allocation of the exchange contexts and calls to the session establishment methods. This commit fixes this problem by allocating exchanges immediately before the calls to the session establishment methods. This removes the possibility of early-out failures causing leaks. Fixes #13422
msandstedt
added a commit
to msandstedt/connectedhomeip
that referenced
this issue
Feb 3, 2022
This requires that we allocate the exchanges right before calling PASESesion::Pair / CASESession::EstablishSession. An equivalent problem is reported in project-chip#13422 for similar code in CHIPDeviceController.cpp.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Problem
At this rev:
In this code:
This was identified here: #13294 (comment)
device->GetPairing().Pair()
will free the exchange on error, but only if it is called. IfmIDAllocator.Allocate(keyID);
fails, this code leaks the exchange.A similar leak for CASE likely exists in OperationalDeviceProxy or CASESessionManager.
Proposed Solution
This would cause this code not to leak:
Perhaps better though would be for PASESession just to allocate its own exchange context.
The text was updated successfully, but these errors were encountered: