Fix a potential use after free - [MOD-8108]#5268
Merged
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #5268 +/- ##
==========================================
- Coverage 86.70% 86.70% -0.01%
==========================================
Files 193 193
Lines 34752 34752
==========================================
- Hits 30133 30131 -2
- Misses 4619 4621 +2 ☔ View full report in Codecov by Sentry. |
alonre24
approved these changes
Nov 27, 2024
This was referenced Nov 27, 2024
GuyAv46
added a commit
that referenced
this pull request
Nov 27, 2024
fix a potential use after free
GuyAv46
added a commit
that referenced
this pull request
Nov 27, 2024
fix a potential use after free
github-merge-queue bot
pushed a commit
that referenced
this pull request
Nov 27, 2024
* Fix MRIterator ownership mechanism - [MOD-8108] (#5244) * implement release mechanism for MRIterator * refactor MRChannel * delete CursorList_Expire * fix test for async cursor deletion * minor cleanup * more cleanup * remove a log message that is now more likely to be logged * log about stuck RQ less frequently * even less noisy * rename MRChannel_Close (cherry picked from commit 6f68d69) * Fix a potential use after free - [MOD-8108] (#5268) fix a potential use after free --------- Co-authored-by: GuyAv46 <[email protected]>
github-merge-queue bot
pushed a commit
that referenced
this pull request
Nov 27, 2024
* Fix MRIterator ownership mechanism - [MOD-8108] (#5244) * implement release mechanism for MRIterator * refactor MRChannel * delete CursorList_Expire * fix test for async cursor deletion * minor cleanup * more cleanup * remove a log message that is now more likely to be logged * log about stuck RQ less frequently * even less noisy * rename MRChannel_Close (cherry picked from commit 6f68d69) * Fix a potential use after free - [MOD-8108] (#5268) fix a potential use after free --------- Co-authored-by: GuyAv46 <[email protected]>
This file contains hidden or 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
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.
Describe the changes in the pull request
A followup of #5244.
Before the above PR, if we created an MR iterator, we had to wait for it to finish its current run before freeing it and additional data of an RPNet result processor. So, we made a shallow copy of the RP command and passed it to the UV thread to duplicate and send to all the shards.
Now that the RPNet's freeing flow doesn't wait for the iterator, this shallow copy is not enough, and we may access the data from the UV thread after it is freed.
In this follow-up, we make a deep copy of the command before passing it to the UV thread, to avoid this potentially unsafe read.
Mark if applicable