-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Backport 2.28: Fix false positives in constant time tests using MSan with Clang 16 #9943
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
Closed
gilles-peskine-arm
wants to merge
6
commits into
Mbed-TLS:mbedtls-2.28
from
gilles-peskine-arm:msancf-clang16-2.28
Closed
Backport 2.28: Fix false positives in constant time tests using MSan with Clang 16 #9943
gilles-peskine-arm
wants to merge
6
commits into
Mbed-TLS:mbedtls-2.28
from
gilles-peskine-arm:msancf-clang16-2.28
Conversation
This file contains hidden or 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
In the documentation of `MBEDTLS_TEST_CONSTANT_FLOW_MEMSAN`, note that since Clang 16, an extra command line option `-fsanitize-memory-param-retval` is required. As documented in the release notes https://releases.llvm.org/16.0.0/tools/clang/docs/ReleaseNotes.html#sanitizers since Clang 16, MSan forbids passing "uninitialized" values in and out of functions. In constant-flow testing, "uninitialized" values are actually secrets that must be manipulated with a data-independent flow, and it's perfectly fine to pass these in and out of functions. Fix Mbed-TLS#9921 Signed-off-by: Gilles Peskine <[email protected]>
New CMake build types CFMemSan, CFMemSanDbg to take care of differing compiler command lines with Clang <15 and Clang >=16. Signed-off-by: Gilles Peskine <[email protected]>
Support Clang >=16 in component_test_memsan_constant_flow. Modern versions of Clang require an extra compiler option to avoid false positives. Fixes Mbed-TLS#9921. Signed-off-by: Gilles Peskine <[email protected]>
Add some basic checks of constant flow sanitizers. In particular, detect the specific way in which Clang 16 broke our constant-flow testing (by default, "uninitialized" values may not be passed to or returned from functions). Signed-off-by: Gilles Peskine <[email protected]>
Signed-off-by: Gilles Peskine <[email protected]>
This was referenced Jan 30, 2025
It wasn't getting declared in some configurations (e.g. config-no-entropy.h). Signed-off-by: Gilles Peskine <[email protected]>
waleed-elmelegy-arm
approved these changes
Feb 1, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Closing as the last 2.28 release has gone out and it will no longer be maintained |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
component-test
Test framework and CI scripts
needs-review
Every commit must be reviewed by at least two team members,
priority-medium
Medium priority - this can be reviewed as time permits
size-xs
Estimated task size: extra small (a few hours at most)
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.
Fix false positives of constant-flow testing when using
MBEDTLS_TEST_CONSTANT_FLOW_MEMSAN
on Clang 16 and above. Fixes #9921. Simple backport of #9922.PR checklist