Skip to content
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

Memory leak issue in the mbedtls_rsa_private function #9635

Open
lchjqss opened this issue Sep 25, 2024 · 0 comments
Open

Memory leak issue in the mbedtls_rsa_private function #9635

lchjqss opened this issue Sep 25, 2024 · 0 comments
Assignees
Labels
component-crypto Crypto primitives and low-level interfaces

Comments

@lchjqss
Copy link

lchjqss commented Sep 25, 2024

Summary

In function mbedtls_rsa_private:

In the flow of the mbedtls_rsa_private function, it first acquires the ctx lock, then initializes several mbedtls_mpi structure variables (such as T, P1, Q1, etc.). However, upon function exit, it releases the lock first and then frees the memory occupied by these mbedtls_mpi structures that were previously allocated. If unlocking fails during function exit, the memory allocated through mbedtls_alloc will not be released, leading to a memory leak issue.

@davidhorstmann-arm davidhorstmann-arm self-assigned this Sep 25, 2024
@davidhorstmann-arm davidhorstmann-arm added the component-crypto Crypto primitives and low-level interfaces label Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component-crypto Crypto primitives and low-level interfaces
Projects
None yet
Development

No branches or pull requests

2 participants