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

FIX(client): Fix memory leaks due to BIO_NOCLOSE flag #6604

Conversation

botanegg
Copy link
Contributor

@botanegg botanegg commented Oct 11, 2024

BIO_set_close with BIO_NOCLOSE argument leads to OpenSSL not (fully)
deleting the allocated BIO struct under the assumption that the user
code has taken ownership of it. However, in our case, this is not the
case and therefore OpenSSL should do the deletion as usual.

The flag was probably introduced under the assumption that the component
that either is or isn't deleted by OpenSSL was the externally provided
buffer that is wrapped into a BIO object via BIO_new_mem_buf. However,
this is not the case. OpenSSL doesn't take ownership of the provided
buffer and therefore also doesn't delete it.

Closes #6603

Checks

@Hartmnt Hartmnt linked an issue Oct 14, 2024 that may be closed by this pull request
@Hartmnt Hartmnt added client bug A bug (error) in the software labels Dec 8, 2024
BIO_set_close with BIO_NOCLOSE argument leads to OpenSSL not (fully)
deleting the allocated BIO struct under the assumption that the user
code has taken ownership of it. However, in our case, this is not the
case and therefore OpenSSL should do the deletion as usual.

The flag was probably introduced under the assumption that the component
that either is or isn't deleted by OpenSSL was the externally provided
buffer that is wrapped into a BIO object via BIO_new_mem_buf. However,
this is not the case. OpenSSL doesn't take ownership of the provided
buffer and therefore also doesn't delete it.

Closes mumble-voip#6603
@Krzmbrzl Krzmbrzl force-pushed the 6603-fix-BIO_NOCLOSE-leads-to-memory-leaks branch from 138f3a4 to 1fcb27f Compare January 12, 2025 17:56
@Krzmbrzl Krzmbrzl changed the title 6603 fix bio noclose leads to memory leaks FIX(client): Fix memory leaks due to BIO_NOCLOSE flag Jan 12, 2025
@Krzmbrzl Krzmbrzl merged commit 66e202f into mumble-voip:master Jan 13, 2025
17 checks passed
@Krzmbrzl
Copy link
Member

Thanks for fixing this!

@Krzmbrzl
Copy link
Member

💔 All backports failed

Status Branch Result
1.5.x Backport failed because of merge conflicts

Manual backport

To create the backport manually run:

backport --pr 6604

Questions ?

Please refer to the Backport tool documentation and see the Github Action logs for details

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport-to-1.5.x bug A bug (error) in the software client
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BIO_NOCLOSE leads to memory leaks while Cert processing
4 participants