memtx: fix 'use after free' of garbage collected MVCC stories#7466
Merged
alyapunov merged 1 commit intotarantool:masterfrom Sep 15, 2022
Merged
Conversation
fab326e to
f01bf2f
Compare
drewdzzz
requested changes
Jul 26, 2022
Contributor
drewdzzz
left a comment
There was a problem hiding this comment.
Please, make the lines of the commit messages shorter, and see my comment about the test. Otherwise, it's OK.
test/box-luatest/gh_7449_tuple_is_dirty_assertion_on_replace_test.lua
Outdated
Show resolved
Hide resolved
f01bf2f to
45e900f
Compare
Member
Author
|
@drewdzzz fixed commit subject length, opened a corresponding issue (tarantool/checkpatch#29). |
drewdzzz
reviewed
Jul 29, 2022
Contributor
drewdzzz
left a comment
There was a problem hiding this comment.
It won't work if we rework GC as we discussed f2f.
45e900f to
9d6d08a
Compare
9353c18 to
d166e45
Compare
d166e45 to
4745224
Compare
alyapunov
suggested changes
Sep 12, 2022
src/box/memtx_tx.c
Outdated
| tuple = entry->to; | ||
| } | ||
|
|
||
| memtx_tx_story_gc(); |
Contributor
There was a problem hiding this comment.
Snapshot cleaner must not collect garbage at least because it may be run from different thread.
Member
Author
There was a problem hiding this comment.
Sorry, I didn't bear that in mind, removed it.
I added it just for the sake of more often garbage collection.
36e3e1a to
2e77c99
Compare
drewdzzz
approved these changes
Sep 12, 2022
alyapunov
suggested changes
Sep 13, 2022
`directly_replaced` stories can potentially get garbage collected in `memtx_tx_handle_gap_write`, which is unexpected and leads to 'use after free': in order to fix this, limit garbage collection points only to external API calls. Wrap all possible garbage collection points with explicit warnings (see c9981a5). Closes tarantool#7449 NO_DOC=bugfix
2e77c99 to
ba16861
Compare
alyapunov
approved these changes
Sep 15, 2022
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.
directly_replacedstories can potentially get garbage collected inmemtx_tx_handle_gap_write, which is unexpected and leads to 'use afterfree': in order to fix this, limit garbage collection points only to
external API calls.
Wrap all possible garbage collection points with explicit warnings (see
c9981a5).
Closes #7449