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 a possible memleak in bind_afalg #23409
Closed
bernd-edlinger
wants to merge
1
commit into
openssl:master
from
bernd-edlinger:fix_memleak_in_bind_afalg
Closed
Fix a possible memleak in bind_afalg #23409
bernd-edlinger
wants to merge
1
commit into
openssl:master
from
bernd-edlinger:fix_memleak_in_bind_afalg
Conversation
This file contains 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
bind_afalg calls afalg_aes_cbc which allocates cipher_handle->_hidden global object(s) but if one of them fails due to out of memory, the function bind_afalg relies on the engine destroy method to be called. But that does not happen because the dynamic engine object is not destroyed in the usual way in dynamic_load in this case: If the bind_engine function fails, there will be no further calls into the shared object. See ./crypto/engine/eng_dyn.c near the comment: /* Copy the original ENGINE structure back */
bernd-edlinger
added
branch: master
Merge to master branch
branch: 3.0
Merge to openssl-3.0 branch
branch: 3.1
Merge to openssl-3.1
branch: 3.2
Merge to openssl-3.2
labels
Jan 28, 2024
tom-cosgrove-arm
added
approval: review pending
This pull request needs review by a committer
approval: otc review pending
This pull request needs review by an OTC member
labels
Jan 29, 2024
tom-cosgrove-arm
approved these changes
Jan 29, 2024
tom-cosgrove-arm
added
tests: exempted
The PR is exempt from requirements for testing
and removed
approval: review pending
This pull request needs review by a committer
labels
Jan 29, 2024
mattcaswell
approved these changes
Jan 29, 2024
mattcaswell
added
approval: done
This pull request has the required number of approvals
and removed
approval: otc review pending
This pull request needs review by an OTC member
labels
Jan 29, 2024
openssl-machine
added
approval: ready to merge
The 24 hour grace period has passed, ready to merge
and removed
approval: done
This pull request has the required number of approvals
labels
Jan 30, 2024
This pull request is ready to merge |
Pushed to master/3.2/3.1/3.0 |
openssl-machine
pushed a commit
that referenced
this pull request
Jan 31, 2024
bind_afalg calls afalg_aes_cbc which allocates cipher_handle->_hidden global object(s) but if one of them fails due to out of memory, the function bind_afalg relies on the engine destroy method to be called. But that does not happen because the dynamic engine object is not destroyed in the usual way in dynamic_load in this case: If the bind_engine function fails, there will be no further calls into the shared object. See ./crypto/engine/eng_dyn.c near the comment: /* Copy the original ENGINE structure back */ Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from #23409)
openssl-machine
pushed a commit
that referenced
this pull request
Jan 31, 2024
bind_afalg calls afalg_aes_cbc which allocates cipher_handle->_hidden global object(s) but if one of them fails due to out of memory, the function bind_afalg relies on the engine destroy method to be called. But that does not happen because the dynamic engine object is not destroyed in the usual way in dynamic_load in this case: If the bind_engine function fails, there will be no further calls into the shared object. See ./crypto/engine/eng_dyn.c near the comment: /* Copy the original ENGINE structure back */ Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from #23409) (cherry picked from commit 729a149)
openssl-machine
pushed a commit
that referenced
this pull request
Jan 31, 2024
bind_afalg calls afalg_aes_cbc which allocates cipher_handle->_hidden global object(s) but if one of them fails due to out of memory, the function bind_afalg relies on the engine destroy method to be called. But that does not happen because the dynamic engine object is not destroyed in the usual way in dynamic_load in this case: If the bind_engine function fails, there will be no further calls into the shared object. See ./crypto/engine/eng_dyn.c near the comment: /* Copy the original ENGINE structure back */ Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from #23409) (cherry picked from commit 729a149)
openssl-machine
pushed a commit
that referenced
this pull request
Jan 31, 2024
bind_afalg calls afalg_aes_cbc which allocates cipher_handle->_hidden global object(s) but if one of them fails due to out of memory, the function bind_afalg relies on the engine destroy method to be called. But that does not happen because the dynamic engine object is not destroyed in the usual way in dynamic_load in this case: If the bind_engine function fails, there will be no further calls into the shared object. See ./crypto/engine/eng_dyn.c near the comment: /* Copy the original ENGINE structure back */ Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from #23409) (cherry picked from commit 729a149)
bernd-edlinger
added a commit
to bernd-edlinger/openssl
that referenced
this pull request
Feb 1, 2024
bind_afalg calls afalg_aes_cbc which allocates cipher_handle->_hidden global object(s) but if one of them fails due to out of memory, the function bind_afalg relies on the engine destroy method to be called. But that does not happen because the dynamic engine object is not destroyed in the usual way in dynamic_load in this case: If the bind_engine function fails, there will be no further calls into the shared object. See ./crypto/engine/eng_dyn.c near the comment: /* Copy the original ENGINE structure back */ Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from openssl#23409) (cherry picked from commit 729a149)
Sashan
pushed a commit
to Sashan/openssl
that referenced
this pull request
Feb 12, 2024
bind_afalg calls afalg_aes_cbc which allocates cipher_handle->_hidden global object(s) but if one of them fails due to out of memory, the function bind_afalg relies on the engine destroy method to be called. But that does not happen because the dynamic engine object is not destroyed in the usual way in dynamic_load in this case: If the bind_engine function fails, there will be no further calls into the shared object. See ./crypto/engine/eng_dyn.c near the comment: /* Copy the original ENGINE structure back */ Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from openssl#23409)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
approval: ready to merge
The 24 hour grace period has passed, ready to merge
branch: master
Merge to master branch
branch: 3.0
Merge to openssl-3.0 branch
branch: 3.1
Merge to openssl-3.1
branch: 3.2
Merge to openssl-3.2
tests: exempted
The PR is exempt from requirements for testing
triaged: bug
The issue/pr is/fixes a bug
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.
bind_afalg calls afalg_aes_cbc which allocates
cipher_handle->_hidden global object(s)
but if one of them fails due to out of memory,
the function bind_afalg relies on the engine destroy method to be called. But that does not happen
because the dynamic engine object is not destroyed in the usual way in dynamic_load in this case:
If the bind_engine function fails, there will be no further calls into the shared object.
See ./crypto/engine/eng_dyn.c near the comment:
/* Copy the original ENGINE structure back */