Skip to content

Fix a potential use after free - [MOD-8108]#5268

Merged
GuyAv46 merged 1 commit intomasterfrom
guyav-followup_5244
Nov 27, 2024
Merged

Fix a potential use after free - [MOD-8108]#5268
GuyAv46 merged 1 commit intomasterfrom
guyav-followup_5244

Conversation

@GuyAv46
Copy link
Collaborator

@GuyAv46 GuyAv46 commented Nov 27, 2024

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

  • This PR introduces API changes
  • This PR introduces serialization changes

@GuyAv46 GuyAv46 requested a review from alonre24 November 27, 2024 16:05
@GuyAv46 GuyAv46 enabled auto-merge November 27, 2024 16:05
@codecov
Copy link

codecov bot commented Nov 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.70%. Comparing base (6f68d69) to head (47486d4).
Report is 1 commits behind head on master.

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.
📢 Have feedback on the report? Share it here.

@GuyAv46 GuyAv46 added this pull request to the merge queue Nov 27, 2024
Merged via the queue into master with commit 64c0270 Nov 27, 2024
@GuyAv46 GuyAv46 deleted the guyav-followup_5244 branch November 27, 2024 17:43
GuyAv46 added a commit that referenced this pull request Nov 27, 2024
GuyAv46 added a commit that referenced this pull request Nov 27, 2024
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants