Skip to content

Commit

Permalink
MSan for constant flow: all.sh: support modern Clang
Browse files Browse the repository at this point in the history
Support Clang >=16 in component_test_memsan_constant_flow and
component_test_memsan_constant_flow_psa. Modern versions of Clang require an
extra compiler option to avoid false positives.

Fixes Mbed-TLS#9921.

Signed-off-by: Gilles Peskine <[email protected]>
  • Loading branch information
gilles-peskine-arm committed Jan 29, 2025
1 parent 8b7afb7 commit 41279cd
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions tests/scripts/components-sanitizers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,15 @@ skip_all_except_given_suite () {
component_test_memsan_constant_flow_psa () {
# This tests both (1) accesses to undefined memory, and (2) branches or
# memory access depending on secret values. To distinguish between those:
# - unset MBEDTLS_TEST_CONSTANT_FLOW_MEMSAN - does the failure persist?
# - or alternatively, change the build type to MemSanDbg, which enables
# - change the build type to MemSan - does the failure persist?
# - or alternatively, change the build type to CFMemSanDbg, which enables
# origin tracking and nicer stack traces (which are useful for debugging
# anyway), and check if the origin was TEST_CF_SECRET() or something else.
msg "build: cmake MSan (clang), full config with constant flow testing"
scripts/config.py full
scripts/config.py set MBEDTLS_TEST_CONSTANT_FLOW_MEMSAN
scripts/config.py unset MBEDTLS_AESNI_C # memsan doesn't grok asm
scripts/config.py unset MBEDTLS_HAVE_ASM
CC=clang cmake -D GEN_FILES=Off -D CMAKE_BUILD_TYPE:String=MemSan .
CC=clang cmake -D GEN_FILES=Off -D CMAKE_BUILD_TYPE:String=CFMemSan .
make

msg "test: main suites (Msan + constant flow)"
Expand Down

0 comments on commit 41279cd

Please sign in to comment.