diff --git a/codebuild/bin/fuzz_corpus_download.sh b/codebuild/bin/fuzz_corpus_download.sh index c38612edc77..0da91abcbf6 100755 --- a/codebuild/bin/fuzz_corpus_download.sh +++ b/codebuild/bin/fuzz_corpus_download.sh @@ -13,11 +13,6 @@ # permissions and limitations under the License. # -# Clean the environment before copying corpuses from the S3 bucket. -# The LD variables may interfere with certificate validation when communicating with AWS S3. -unset LD_PRELOAD -unset LD_LIBRARY_PATH - for FUZZ_TEST in tests/fuzz/*.c; do # extract file name without extension TEST_NAME=$(basename "$FUZZ_TEST") diff --git a/codebuild/bin/fuzz_corpus_upload.sh b/codebuild/bin/fuzz_corpus_upload.sh index 17dd4033b38..8100e074166 100755 --- a/codebuild/bin/fuzz_corpus_upload.sh +++ b/codebuild/bin/fuzz_corpus_upload.sh @@ -13,17 +13,12 @@ # permissions and limitations under the License. # -# Clean the environment before copying corpuses to the S3 bucket. -# The LD variables may interfere with certificate validation when communicating with AWS S3. -unset LD_PRELOAD -unset LD_LIBRARY_PATH - for FUZZ_TEST in tests/fuzz/*.c; do # extract file name without extension TEST_NAME=$(basename "$FUZZ_TEST") TEST_NAME="${TEST_NAME%.*}" - # Store generated corpus files in the S3 bucket. + # Upload generated corpus files to the S3 bucket. zip -r ./tests/fuzz/corpus/${TEST_NAME}.zip ./tests/fuzz/corpus/${TEST_NAME}/ > /dev/null 2>&1 aws s3 cp ./tests/fuzz/corpus/${TEST_NAME}.zip s3://s2n-tls-fuzz-corpus/${TEST_NAME}/corpus.zip done diff --git a/codebuild/bin/fuzz_coverage_report.sh b/codebuild/bin/fuzz_coverage_report.sh index 6e2a4afcf23..a35e4e77d4e 100755 --- a/codebuild/bin/fuzz_coverage_report.sh +++ b/codebuild/bin/fuzz_coverage_report.sh @@ -16,7 +16,7 @@ set -e usage() { - echo "Usage: calcTotalCov.sh" + echo "Usage: fuzz_coverage_report.sh" exit 1 } diff --git a/codebuild/spec/buildspec_fuzz_scheduled.yml b/codebuild/spec/buildspec_fuzz_scheduled.yml index 34c323d6607..29c9c8b354e 100644 --- a/codebuild/spec/buildspec_fuzz_scheduled.yml +++ b/codebuild/spec/buildspec_fuzz_scheduled.yml @@ -15,9 +15,8 @@ version: 0.2 env: variables: - CC: "/usr/bin/clang" - CXX: "/usr/bin/clang++" S2N_LIBCRYPTO: "awslc" + COMPILER: clang phases: pre_build: @@ -32,6 +31,7 @@ phases: - | cmake . -Bbuild \ -DCMAKE_PREFIX_PATH=/usr/local/$S2N_LIBCRYPTO \ + -DCMAKE_C_COMPILER=/usr/bin/$COMPILER \ -DS2N_FUZZ_TEST=on \ -DCOVERAGE=on \ -DBUILD_SHARED_LIBS=on diff --git a/tests/fuzz/Readme.md b/tests/fuzz/Readme.md index c178f6473ca..49fe930f39b 100644 --- a/tests/fuzz/Readme.md +++ b/tests/fuzz/Readme.md @@ -50,12 +50,6 @@ cmake . -Bbuild \ cmake --build ./build -- -j $(nproc) ``` -If you see an error that says `This project requires clang for coverage support. You are currently using X`, set the C compiler environment variable to use Clang: -``` -export CC=/usr/bin/clang -export CXX=/usr/bin/clang++ -``` - Next, run fuzz tests. This generates `.info` files for each fuzz test containing coverage information. ``` cmake --build build/ --target test -- ARGS="-L fuzz --output-on-failure" diff --git a/tests/fuzz/runFuzzTest.sh b/tests/fuzz/runFuzzTest.sh index 5f5fa81d5de..1a70e797fb3 100755 --- a/tests/fuzz/runFuzzTest.sh +++ b/tests/fuzz/runFuzzTest.sh @@ -41,9 +41,6 @@ else EXPECTED_TEST_FAILURE=0 fi -ASAN_OPTIONS+="symbolize=1" -LSAN_OPTIONS+="log_threads=1" -UBSAN_OPTIONS+="print_stacktrace=1" LIBFUZZER_ARGS+="-timeout=5 -max_len=4096 -print_final_stats=1 -max_total_time=${FUZZ_TIMEOUT_SEC}" TEST_SPECIFIC_OVERRIDES="${S2N_ROOT}/build/lib/lib${TEST_NAME}_overrides.so"