Fix interconnection udpifc UAF in ipc teardown#95
Merged
avamingli merged 1 commit intoapache:mainfrom Jul 27, 2023
Merged
Conversation
Problem details: In function chunkTransportStateEntryInitialized got **wrong** valid with motNodeID When tear down happen in udpifc, the outgoing route may not delete entry in shared htab. The htab will be shared with rxthread. After main thread tear down, some of conns will be freed by MemoryContextReset But in the same time, htab will hold the invalid conn ptr in rxthread Then got core dump. Fixed: Changed the chunkTransportStateEntryInitialized, using the getChunkTransportState* to get the right entry Also do not direct access states in ChunkTransportState.
Contributor
|
LGTM |
my-ship-it
approved these changes
Jul 27, 2023
yjhjstz
approved these changes
Jul 27, 2023
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.
Cherry-pick from Gitlab master branch to fix udpifc crash.
Problem details:
In function chunkTransportStateEntryInitialized got wrong valid with motNodeID When tear down happen in udpifc, the outgoing route may not delete entry in shared htab. The htab will be shared with rxthread.
After main thread tear down, some of conns will be freed by MemoryContextReset But in the same time, htab will hold the invalid conn ptr in rxthread Then got core dump.
Fixed:
Changed the chunkTransportStateEntryInitialized, using the getChunkTransportState* to get the right entry Also do not direct access states in ChunkTransportState.
closes: #ISSUE
Change logs
Describe your change clearly, including what problem is being solved or what feature is being added.
If it has some breaking backward or forward compatibility, please clary.
Why are the changes needed?
Describe why the changes are necessary.
Does this PR introduce any user-facing change?
If yes, please clarify the previous behavior and the change this PR proposes.
How was this patch tested?
Please detail how the changes were tested, including manual tests and any relevant unit or integration tests.
Contributor's Checklist
Here are some reminders before you submit the pull request:
make installcheckmake -C src/test installcheck-cbdb-parallel