From 3b0f3a44d7b885cf04fbcf7fdb1f5b5bc0551109 Mon Sep 17 00:00:00 2001 From: Sergey Bronnikov Date: Wed, 31 May 2023 22:25:32 +0300 Subject: [PATCH 1/3] freerdp: enable BUILD_TESTING in CMake It is required because some modules enables testing only with this flag. --- projects/freerdp/build.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/projects/freerdp/build.sh b/projects/freerdp/build.sh index c80c163f051b..bcfe479a4938 100755 --- a/projects/freerdp/build.sh +++ b/projects/freerdp/build.sh @@ -53,6 +53,7 @@ cmake_args=( -DBUILD_SHARED_LIBS=OFF -DOSS_FUZZ=ON -DBUILD_FUZZERS=ON + -DBUILD_TESTING=ON # C compiler -DCMAKE_C_COMPILER="${CC}" From 31f9aa482ae72325ea9773d80c03ab3c716a3e0a Mon Sep 17 00:00:00 2001 From: Sergey Bronnikov Date: Wed, 31 May 2023 22:26:19 +0300 Subject: [PATCH 2/3] freerdp: build fuzzers with a single target --- projects/freerdp/build.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/projects/freerdp/build.sh b/projects/freerdp/build.sh index bcfe479a4938..d8db139d6cbf 100755 --- a/projects/freerdp/build.sh +++ b/projects/freerdp/build.sh @@ -47,6 +47,10 @@ cmake_args=( -DWITH_KRB5=OFF -DWITH_FUSE=OFF + # clang-15 segfaults on linking binaries when LTO is enabled, + # see https://github.com/google/oss-fuzz/pull/10448#issuecomment-1578160436 + -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=FALSE + $SANITIZERS_ARGS -DCMAKE_BUILD_TYPE=Debug @@ -73,7 +77,7 @@ cmake_args=( # Build the project and fuzzers. rm -rf build cmake "${cmake_args[@]}" -S . -B build -G Ninja -cmake --build build --parallel --target TestFuzzCryptoCertificateDataSetPEM +cmake --build build --parallel --target fuzzers for f in $(find build/Testing/ -name 'TestFuzz*' -type f); do From 69cb4351b17b4db110168ffd09efce55da9a9b7c Mon Sep 17 00:00:00 2001 From: Sergey Bronnikov Date: Tue, 6 Jun 2023 22:57:48 +0300 Subject: [PATCH 3/3] freerdp: disable MemorySanitizer MSan triggers on OpenSSL function: ``` Uninitialized bytes in __interceptor_fopen64 at offset 0 inside [0x7020000178c0, 25) ==182==WARNING: MemorySanitizer: use-of-uninitialized-value #0 0xe59129 in BIO_new_file (/tmp/not-out/tmpl27pqwad/TestFuzzCommonAssistanceParseFileBuffer+0xe59129) #1 0xfbd25d in def_load conf_def.o #2 0xe69a9c in CONF_modules_load_file (/tmp/not-out/tmpl27pqwad/TestFuzzCommonAssistanceParseFileBuffer+0xe69a9c) #3 0xf50bdf in openssl_config_int (/tmp/not-out/tmpl27pqwad/TestFuzzCommonAssistanceParseFileBuffer+0xf50bdf) #4 0xeb00f3 in ossl_init_config_ossl_ init.o ``` According to an issue [1] it is a false positive, MemorySanitizer requires fully instrumented builds to be able to use the it. Disable MemorySanitizer for now. 1. https://github.com/openssl/openssl/issues/11013 --- projects/freerdp/project.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/projects/freerdp/project.yaml b/projects/freerdp/project.yaml index eb429f8b9abd..e5a901c60040 100644 --- a/projects/freerdp/project.yaml +++ b/projects/freerdp/project.yaml @@ -12,6 +12,5 @@ fuzzing_engines: - libfuzzer sanitizers: - address - - memory architectures: - x86_64