Skip to content

v5: Fix invalid access after free in do_recv: Coverity CID 1517308 #11218

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

Merged
merged 1 commit into from
Dec 20, 2022

Conversation

jjhursey
Copy link
Member

@jjhursey jjhursey commented Dec 19, 2022

Coverity static analysis reported an invalid memory access after free in memheap_base_mkey.c(do_recv) for the OBJ_RELEASE macro at line 238.

The send_buffer function call at line 234 unconditionally frees memory pointed to by msg, using a PMIX_DATA_BUFFER_RELEASE macro.

The existing code was then freeing msg again, by use of an OBJ_RELEASE macro if send_buffer failed.

This has the potential for a crash, SIGSEGV or possibly an error in free().

The invocation of OBJ_RELEASE is removed.

Signed-off-by: David Wootton [email protected]
(cherry picked from commit e8fec0a)

Coverity static analysis reported an invalid memory access after free in memheap_base_mkey.c(do_recv) for the OBJ_RELEASE macro at line 238.

The send_buffer function call at line 234 unconditionally frees memory pointed to by msg, using a PMIX_DATA_BUFFER_RELEASE macro.

The existing code was then freeing msg again, by use of an OBJ_RELEASE macro if send_buffer failed.

This has the potential for a crash, SIGSEGV or possibly an error in free().

The invocation of OBJ_RELEASE is removed.

Signed-off-by: David Wootton <[email protected]>
(cherry picked from commit e8fec0a)
@jjhursey jjhursey changed the title Fix invalid access after free in do_recv: Coverity CID 1517308 v5: Fix invalid access after free in do_recv: Coverity CID 1517308 Dec 19, 2022
@janjust janjust merged commit 39e379c into open-mpi:v5.0.x Dec 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants