protect the info passed to pmix_tool_connected_fn #1871
Closed
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.
The info array passed to pmix_tool_connected_fn is also part of the cbdata (i.e. a member of the pmix_pending_connection_t struct) and gets assigned to the pmix_server_req_t struct.
When calling the callback function provided by the openpmix server implementation, the PMIx server releases the pmix_pending_connection_t struct (including the info array).
Likewise, PRRTE releases the pmix_server_req_t struct (including the info array).
Thus a double free happens on the info array, potentially leading to invalid memory accesses.
This patch protects the info passed to pmix_tool_connected_fn by assigning a copy of the info to the pmix_server_req_t struct instead of the original info.