-
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
No longer provide OperationDeviceProxy in OnDeviceConnected callback #21256
Merged
tehampson
merged 34 commits into
project-chip:master
from
tehampson:operational-device-proxy-19259-part-3
Aug 5, 2022
Merged
No longer provide OperationDeviceProxy in OnDeviceConnected callback #21256
tehampson
merged 34 commits into
project-chip:master
from
tehampson:operational-device-proxy-19259-part-3
Aug 5, 2022
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pullapprove
bot
requested review from
andy31415,
anush-apple,
arkq,
Byungjoo-Lee,
bzbarsky-apple,
carol-apple,
chrisdecenzo,
chshu,
chulspro,
Damian-Nordic,
dhrishi,
electrocucaracha,
erjiaqing,
franck-apple,
gjc13,
harimau-qirex,
harsha-rajendran,
hawk248,
isiu-apple,
jelderton,
jepenven-silabs,
jmartinez-silabs,
jtung-apple,
lazarkov,
LuDuda,
mrjerryjohns,
msandstedt,
mspang and
rgoliver
July 27, 2022 00:56
PR #21256: Size comparison from ce65402 to d5e978c Increases above 0.2%:
Increases (23 builds for cc13x2_26x2, linux, nrfconnect, p6, telink)
Decreases (35 builds for bl602, cc13x2_26x2, cyw30739, efr32, k32w, linux, mbed, nrfconnect, p6)
Full report (49 builds for bl602, cc13x2_26x2, cyw30739, efr32, k32w, linux, mbed, nrfconnect, p6, telink)
|
PR #21256: Size comparison from ce65402 to 126d18d Increases above 0.2%:
Increases (25 builds for cc13x2_26x2, esp32, linux, nrfconnect, p6, telink)
Decreases (37 builds for bl602, cc13x2_26x2, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, p6)
Full report (51 builds for bl602, cc13x2_26x2, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, p6, telink)
|
mrjerryjohns
reviewed
Aug 4, 2022
mrjerryjohns
approved these changes
Aug 4, 2022
mrjerryjohns
reviewed
Aug 4, 2022
mrjerryjohns
reviewed
Aug 4, 2022
PR #21256: Size comparison from ce65402 to af29fe6 Increases above 0.2%:
Increases (19 builds for cc13x2_26x2, linux, p6, telink)
Decreases (27 builds for bl602, cc13x2_26x2, cyw30739, efr32, k32w, linux, mbed, p6)
Full report (39 builds for bl602, cc13x2_26x2, cyw30739, efr32, k32w, linux, mbed, p6, telink)
|
PR #21256: Size comparison from ce65402 to 5af3c25 Increases above 0.2%:
Increases (25 builds for cc13x2_26x2, esp32, linux, nrfconnect, p6, telink)
Decreases (37 builds for bl602, cc13x2_26x2, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, p6)
Full report (51 builds for bl602, cc13x2_26x2, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, p6, telink)
|
bzbarsky-apple
approved these changes
Aug 5, 2022
bzbarsky-apple
added a commit
to bzbarsky-apple/connectedhomeip
that referenced
this pull request
Aug 31, 2022
Before project-chip#21256 AutoCommissioner used the operational proxy if it existed at all. This could happen even if it was disconnected, as long as it had been connected at some point in the past. This was accidentally changed to "use the operational proxy only if it's connected" in project-chip#21256. This can lead to a crash, as described in project-chip#22268 (comment), if shutdown happens after the operational proxy is connected but before we get a response to CommissioningComplete. In that case, we will evict our CASE session, which will error out the CommissioningComplete command we sent and try to clean up, but it will select the (now dangling!) mCommissioneeDeviceProxy instead of correctly selecting mOperationalDeviceProxy, because the mOperationalDeviceProxy no longer has a session at that point. The fix is to check for an "initialized" (in the sense that it has a valid peer node id) mOperationalDeviceProxy instead of checking for a connected one. This matches the semantics of the check we used to have before project-chip#21256. Fixes project-chip#22293
bzbarsky-apple
added a commit
that referenced
this pull request
Aug 31, 2022
Before #21256 AutoCommissioner used the operational proxy if it existed at all. This could happen even if it was disconnected, as long as it had been connected at some point in the past. This was accidentally changed to "use the operational proxy only if it's connected" in #21256. This can lead to a crash, as described in #22268 (comment), if shutdown happens after the operational proxy is connected but before we get a response to CommissioningComplete. In that case, we will evict our CASE session, which will error out the CommissioningComplete command we sent and try to clean up, but it will select the (now dangling!) mCommissioneeDeviceProxy instead of correctly selecting mOperationalDeviceProxy, because the mOperationalDeviceProxy no longer has a session at that point. The fix is to check for an "initialized" (in the sense that it has a valid peer node id) mOperationalDeviceProxy instead of checking for a connected one. This matches the semantics of the check we used to have before #21256. Fixes #22293
isiu-apple
pushed a commit
to isiu-apple/connectedhomeip
that referenced
this pull request
Sep 16, 2022
…roject-chip#21256) Previous implementations of OnDeviceConnected held onto OperationalDeviceProxy when they really should not have could lead to use after free should something else free that OperationalDeviceProxy.
isiu-apple
pushed a commit
to isiu-apple/connectedhomeip
that referenced
this pull request
Sep 16, 2022
Before project-chip#21256 AutoCommissioner used the operational proxy if it existed at all. This could happen even if it was disconnected, as long as it had been connected at some point in the past. This was accidentally changed to "use the operational proxy only if it's connected" in project-chip#21256. This can lead to a crash, as described in project-chip#22268 (comment), if shutdown happens after the operational proxy is connected but before we get a response to CommissioningComplete. In that case, we will evict our CASE session, which will error out the CommissioningComplete command we sent and try to clean up, but it will select the (now dangling!) mCommissioneeDeviceProxy instead of correctly selecting mOperationalDeviceProxy, because the mOperationalDeviceProxy no longer has a session at that point. The fix is to check for an "initialized" (in the sense that it has a valid peer node id) mOperationalDeviceProxy instead of checking for a connected one. This matches the semantics of the check we used to have before project-chip#21256. Fixes project-chip#22293
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
What is being fixed? Examples:
OperationalDeviceProxy
shareable by multiple applications, and delivers its callbacks to multiple applications #19259Change overview
OperationalDeviceProxy
as an interim solution since this is already a large refactor. We are hoping in the future others will refactor sections of code usingOperationalDeviceProxy
and move towards a more proper implementation.Testing
How was this tested? (at least one bullet point required)