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

Remove a potential call to fwrite with null buffer. Add UBsan testing #239

Merged
merged 3 commits into from
Sep 5, 2019

Conversation

AndrzejKurek
Copy link
Contributor

@AndrzejKurek AndrzejKurek commented Aug 28, 2019

This PR handles issue #203.
First commit removes a potential call to fwrite with a null buffer, and second extends testing.

Tested locally on Ubuntu 16.04 with gcc 5.4 - after extending the testing in CMakeLists and before adding the null check Asan type build fails (and therefore all.sh too). With these two commits - everything passes.

Before merging, this PR will also need a changelog entry to credit nanokatze who has filed this issue.

@Patater Patater added bug Something isn't working needs: ci Needs a passing full CI run needs: review The pull request is ready for review. This generally means that it has no known issues. labels Aug 28, 2019
Copy link
Collaborator

@gilles-peskine-arm gilles-peskine-arm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is ok in that it makes the test pass, but the check could be made more robust at zero cost.

library/psa_its_file.c Outdated Show resolved Hide resolved
library/psa_its_file.c Outdated Show resolved Hide resolved
@AndrzejKurek
Copy link
Contributor Author

Updated the PR. Did not add an additional test to fill in the testing gap after removing MEMORY_BUFFER_ALLOC, since it's bound to be removed anyway here: Mbed-TLS/mbedtls#2469

Andrzej Kurek and others added 3 commits September 5, 2019 09:34
Previously, not all flags were supported by the gcc version that was used
(pre-4.9). Now, since the minimum version gcc version tested is 5.4, 
the flags can be unified.
Enabling MBEDTLS_MEMORY_BUFFER_ALLOC_C bypasses ASan leak checks
because system calloc() and free() aren't used.
@Patater Patater removed the needs: review The pull request is ready for review. This generally means that it has no known issues. label Sep 5, 2019
@Patater Patater merged commit c12cb52 into ARMmbed:development Sep 5, 2019
@Patater Patater removed the needs: ci Needs a passing full CI run label Sep 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants