Skip to content
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

fix use after free in index_lock #546

Merged
merged 2 commits into from
Dec 3, 2021

Conversation

Alexey-N-Chernyshov
Copy link
Contributor

Signed-off-by: Alexey Chernyshov alexey.n.chernyshov@gmail.com

Description of the Change

Fix use after free in index lock.
sectors.erase(lock.sector); deletes sector and then sector.cv is accessed and sector_lock still holds sector.mutex.

Benefits

Possible Drawbacks

Usage Examples or Tests [optional]

Alternate Designs [optional]

Signed-off-by: Alexey Chernyshov <alexey.n.chernyshov@gmail.com>
@codecov
Copy link

codecov bot commented Dec 3, 2021

Codecov Report

Merging #546 (bb2eb21) into master (e59a5b3) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #546   +/-   ##
=======================================
  Coverage   46.38%   46.38%           
=======================================
  Files         680      680           
  Lines       30255    30256    +1     
  Branches    16759    16760    +1     
=======================================
+ Hits        14034    14035    +1     
  Misses      12182    12182           
  Partials     4039     4039           
Impacted Files Coverage Δ
core/sector_storage/stores/impl/index_lock.cpp 84.09% <100.00%> (+0.36%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e59a5b3...bb2eb21. Read the comment docs.

@Alexey-N-Chernyshov Alexey-N-Chernyshov merged commit 5fcc3bb into master Dec 3, 2021
@Alexey-N-Chernyshov Alexey-N-Chernyshov deleted the fix/index-lock-use-after-free branch December 3, 2021 11:36
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.

None yet

3 participants