-
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
ExchangeContext: Implement a safer verion Abort/Close #19775
Conversation
PR #19775: Size comparison from 48606c6 to 432255d Increases (39 builds for cc13x2_26x2, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, p6, telink)
Decreases (5 builds for cc13x2_26x2)
Full report (41 builds for cc13x2_26x2, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, p6, telink)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this changes the application contract for how exchange refcounts work, it seems quite risky for pre-1.0 work at this point.
In particular, this seems to be assuming OnExchangeClosing implementations throughout which simply don't exist, unless I am missing something, which will lead to dangling pointers and use-after-free...
And fwiw, I don't see any tests in this PR covering the interesting scenarios here, and I am quite sure our existing unit tests do not exercise them. |
I'd tend to agree as well that this is likely something we want post 1.0. |
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
This stale pull request has been automatically closed. Thank you for your contributions. |
Problem
Fixes #19747 Use-after-free when aborting already-closed exchange
Change overview
This change is based on following concepts
kFlagClosed
.Note: Currently, there are 3 types of ref counts to an exchange
kFlagClosed
ExchangeHandle
in member functions of ExchangeContexExchangeHandle
inRetransTableEntry
Testing
Verified by unit-tests.