[cryptofuzz] Fix SymCrypt MSAN issues (#9951)

This commit is contained in:
Guido Vranken 2023-03-20 13:00:02 +01:00 committed by GitHub
parent 6e4788aa3a
commit 12d55ec698
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 1 deletions

View File

@ -238,12 +238,25 @@ make -B -j$(nproc)
## Compile SymCrypt ## Compile SymCrypt
cd $SRC/SymCrypt/ cd $SRC/SymCrypt/
# Disable speculative load hardening because
# this results in MSAN false positives
sed -i '/.*x86-speculative-load-hardening.*/d' lib/CMakeLists.txt
sed -i '/.*x86-speculative-load-hardening.*/d' modules_linux/common/ModuleCommon.cmake
# Unittests don't build with clang and are not needed anyway # Unittests don't build with clang and are not needed anyway
sed -i "s/^add_subdirectory(unittest)$//g" CMakeLists.txt sed -i "s/^add_subdirectory(unittest)$//g" CMakeLists.txt
mkdir b/ mkdir b/
cd b/ cd b/
cmake ../ if [[ $CFLAGS = *sanitize=memory* ]]
then
cmake -DSYMCRYPT_USE_ASM=off ../
else
cmake ../
fi
make symcrypt_common symcrypt_generic -j$(nproc) make symcrypt_common symcrypt_generic -j$(nproc)
export CXXFLAGS="$CXXFLAGS -DCRYPTOFUZZ_SYMCRYPT" export CXXFLAGS="$CXXFLAGS -DCRYPTOFUZZ_SYMCRYPT"