-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
mbedtls 2.16.0 causes Open Broadcast Studio crash #2409
Comments
@mcli Thank you for reporting this! |
ARM Internal Ref: IOTSSL-2761 |
Unfortunately I can confirm mbedTLS v2.16.0 also causes a crash within my application running on a STM32F7. Going back to v2.13.0 (as I had previously) did NOT trigger the same issue. |
@RobertBeekmans Thank you for your input! |
I'm using mbedTLS with the following as a client within our embedded application:
After a successful TLS handshake, data is being transferred between client and server and sometimes data of the FLASH file system get corrupted (results in not being able to search for files). |
According to the log" malloc(): smallbin double linked list corrupted" and additional input from @RobertBeekmans , I am assuming there is some sort of memory overflow in the system. Unfortunately, we still haven't managed to reproduce this. I am trying to narrow down the versions. Does this crash happen on version 2.14.1 and \ or 2.15.1 ( the latter was not release as a standalone release, but for Mbed OS, but it could be used as well for the purpose of reproduction)? |
Just an idea, but we removed some checks on parameters that the caller should be responsible for ensuring are correct before calling. Perhaps some of the parameters passed to Mbed TLS are invalid and not getting caught or ignored as in previous versions of Mbed TLS. Could you try to reproduce the issue with An excerpt from the documentation for this feature:
|
Hi All, I finally got around to running obs in a debugger using the debuginfo rpms. I haven't yet got around to compiling mbedtls yet, but maybe we can make some progress looking at the initialized structure.
Here is the RTMP_TLS_ctx structure contents (conf expanded) after the initialization sequence. I see that there is some uninitialized memory (psk_len, psk_identity_len). Let me know if there is anything else you'd like to look at.
|
@mcli Thank you for your information. |
@RonEld Here is the beginning portion of RTMP_TLS_LoadCerts(). The program crashes on the calloc. The call to
|
@RonEld, @mpg Here's the complete back trace:
|
Hi @mcli, thank you for the information! As mentioned earlier, it looks like there is some heap corruption, e.g. due to a buffer overflow or double free. Alternatively to @Patater's suggestion of turning on parameter validation: Can you compile the library with an address sanitizer enabled to see where the (likely) corruption is happening? Regards, |
Hi All, I traced the problem to I'm interested in soliciting your opinions as to what the proper fix should be. I'm willing to code it along with a test for a pull request. |
Hi @mcli It is strange though why this didn't happen on |
Since to my understanding, this is a feature request, and not a bug, changing the label to "enhancement" |
I can confirm mbedTLS v2.16.1 runs fine now with my application running on a STM32F7 (and it uses the STM32 HW crypto accell as implemented within mbed OS for AES, MD5, SHA1 and SHA256). |
@RobertBeekmans Thank you for your information |
Looking closely at the stacktrace and description, this seems to be a duplicate of #3005, which was fixed on the OBS side by obsproject/obs-studio@4d89123. I'll close this as fixed elsewhere. |
Description
On Fedora 29, mbedtls 2.16.0 causes Open Broadcast Studio to crash immediately when starting to stream.
Works when using mbedtls 2.13.0. Core dump stack trace excerpt quoted below. Original issue is on Open Broadcast Studio forum: https://obsproject.com/forum/threads/start-streaming-causes-instant-crash-coredump.99615/
OS
Linux - Fedora 29
mbed TLS build:
Version: 2.16.0
OS version: 4.20.5
Configuration: Fedora 29 x86_64
Compiler and options:
Precompiled binary from Fedora 29 update
Additional environment information:
Peer device TLS stack and version
Other - Open Broadcast Studio
Version: 22.0.3
Expected behavior
OBS should not crash when starting to stream.
Actual behavior
crashes (see stack trace above)
Steps to reproduce
Run Open Broadcast Studio and start streaming
The text was updated successfully, but these errors were encountered: