From 22863868d3289b7b9fda9e9e5e83c4df3ab846f4 Mon Sep 17 00:00:00 2001 From: Jonathan Metzman Date: Wed, 28 Dec 2022 13:16:14 -0500 Subject: [PATCH 01/16] Make centipede a default fuzzer Related: https://github.com/google/oss-fuzz/issues/9299 --- infra/build/functions/build_project.py | 6 +++--- infra/ci/build.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/infra/build/functions/build_project.py b/infra/build/functions/build_project.py index 23ec94810f55..cbca6c909311 100755 --- a/infra/build/functions/build_project.py +++ b/infra/build/functions/build_project.py @@ -42,7 +42,7 @@ GCB_LOGS_BUCKET = 'oss-fuzz-gcb-logs' DEFAULT_ARCHITECTURES = ['x86_64'] -DEFAULT_ENGINES = ['libfuzzer', 'afl', 'honggfuzz'] +DEFAULT_ENGINES = ['libfuzzer', 'afl', 'honggfuzz', 'centipede'] DEFAULT_SANITIZERS = ['address', 'undefined'] LATEST_VERSION_FILENAME = 'latest.version' @@ -118,7 +118,7 @@ def get_sanitizer_strings(sanitizers): return processed_sanitizers -def set_default_sanitizer_for_centipede(project_yaml): +def add_none_sanitizer_for_centipede(project_yaml): """Adds none as a sanitizer for centipede in yaml if it does not exist yet.""" # Centipede requires a separate unsanitized binary to use sanitized ones. if ('centipede' in project_yaml['fuzzing_engines'] and @@ -177,7 +177,7 @@ def set_yaml_defaults(project_yaml): project_yaml.setdefault('labels', {}) # Adds 'none' as a sanitizer for centipede to the project yaml by default, # because Centipede always requires a separate build of unsanitized binary. - set_default_sanitizer_for_centipede(project_yaml) + add_none_sanitizer_for_centipede(project_yaml) def is_supported_configuration(build): diff --git a/infra/ci/build.py b/infra/ci/build.py index 8e573ae68f20..18a22c95d6d0 100755 --- a/infra/ci/build.py +++ b/infra/ci/build.py @@ -33,7 +33,7 @@ CANARY_PROJECT = 'skcms' DEFAULT_ARCHITECTURES = ['x86_64'] -DEFAULT_ENGINES = ['afl', 'honggfuzz', 'libfuzzer'] +DEFAULT_ENGINES = ['afl', 'honggfuzz', 'libfuzzer', 'centipede'] DEFAULT_SANITIZERS = ['address', 'undefined'] From 2aa85ce34ccb1669160b449e20e1a1508692f4e3 Mon Sep 17 00:00:00 2001 From: Jonathan Metzman Date: Mon, 6 Feb 2023 23:33:57 -0500 Subject: [PATCH 02/16] fast test --- infra/build/functions/trial_build.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/infra/build/functions/trial_build.py b/infra/build/functions/trial_build.py index 68f4f2d8179c..e69d019cb653 100644 --- a/infra/build/functions/trial_build.py +++ b/infra/build/functions/trial_build.py @@ -341,7 +341,9 @@ def trial_build_main(args=None, local_base_build=True): build_and_push_test_images.build_and_push_images( # pylint: disable=unexpected-keyword-arg test_image_suffix) else: - build_and_push_test_images.gcb_build_and_push_images(test_image_suffix) + # !!! + # build_and_push_test_images.gcb_build_and_push_images(test_image_suffix) + pass return _do_test_builds(args, test_image_suffix) From 5f7a91f3f48724407505fa642a21b92f7ecbdc5f Mon Sep 17 00:00:00 2001 From: Jonathan Metzman Date: Tue, 7 Feb 2023 00:05:34 -0500 Subject: [PATCH 03/16] fix --- infra/build/functions/trial_build.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/infra/build/functions/trial_build.py b/infra/build/functions/trial_build.py index e69d019cb653..68f4f2d8179c 100644 --- a/infra/build/functions/trial_build.py +++ b/infra/build/functions/trial_build.py @@ -341,9 +341,7 @@ def trial_build_main(args=None, local_base_build=True): build_and_push_test_images.build_and_push_images( # pylint: disable=unexpected-keyword-arg test_image_suffix) else: - # !!! - # build_and_push_test_images.gcb_build_and_push_images(test_image_suffix) - pass + build_and_push_test_images.gcb_build_and_push_images(test_image_suffix) return _do_test_builds(args, test_image_suffix) From 4ae740aa28609195e35cc0b71b91dd64cbb1a2cf Mon Sep 17 00:00:00 2001 From: Jonathan Metzman Date: Tue, 7 Feb 2023 11:38:51 -0500 Subject: [PATCH 04/16] Fix --- projects/cfengine/project.yaml | 4 ++++ projects/cpython3/project.yaml | 4 ++++ projects/curl/project.yaml | 4 ++++ projects/cyclonedds/project.yaml | 4 ++++ projects/libtorrent/project.yaml | 4 ++++ projects/skia/project.yaml | 4 ++++ projects/sound-open-firmware/project.yaml | 4 ++++ projects/spdk/project.yaml | 4 ++++ projects/suricata/project.yaml | 4 ++++ 9 files changed, 36 insertions(+) diff --git a/projects/cfengine/project.yaml b/projects/cfengine/project.yaml index 4db793d6eac6..628473126900 100644 --- a/projects/cfengine/project.yaml +++ b/projects/cfengine/project.yaml @@ -4,6 +4,10 @@ language: c++ primary_contact: "vratislav.podzimek@northern.tech" auto_ccs: - "Adam@adalogics.com" +fuzzing_engines: + - afl + - honggfuzz + - libfuzzer sanitizers: - address - undefined diff --git a/projects/cpython3/project.yaml b/projects/cpython3/project.yaml index 9d35b1649046..08de86bab0a8 100644 --- a/projects/cpython3/project.yaml +++ b/projects/cpython3/project.yaml @@ -5,6 +5,10 @@ main_repo: "https://github.com/python/cpython" auto_ccs: - "alex.gaynor@gmail.com" - "ammar@ammaraskar.com" +fuzzing_engines: + - afl + - honggfuzz + - libfuzzer sanitizers: - address - memory diff --git a/projects/curl/project.yaml b/projects/curl/project.yaml index 71e6905a4f3c..52f49948d50e 100644 --- a/projects/curl/project.yaml +++ b/projects/curl/project.yaml @@ -8,6 +8,10 @@ sanitizers: - address - undefined - memory +fuzzing_engines: + - afl + - honggfuzz + - libfuzzer architectures: - x86_64 - i386 diff --git a/projects/cyclonedds/project.yaml b/projects/cyclonedds/project.yaml index 704a0440a84d..8bb114a9af8b 100644 --- a/projects/cyclonedds/project.yaml +++ b/projects/cyclonedds/project.yaml @@ -3,6 +3,10 @@ language: c auto_ccs: - "federico.maggi@gmail.com" primary_contact: "eb@ilities.com" +fuzzing_engines: + - afl + - honggfuzz + - libfuzzer sanitizers: - address - undefined diff --git a/projects/libtorrent/project.yaml b/projects/libtorrent/project.yaml index 7fc3c834d86e..74c9766b4345 100644 --- a/projects/libtorrent/project.yaml +++ b/projects/libtorrent/project.yaml @@ -5,3 +5,7 @@ auto_ccs: - "oss-fuzz-libtorrent@pauldreik.se" - "arvid.norberg@gmail.com" main_repo: 'https://github.com/arvidn/libtorrent.git' +fuzzing_engines: + - afl + - honggfuzz + - libfuzzer diff --git a/projects/skia/project.yaml b/projects/skia/project.yaml index bc7b6c6c76de..8c2cdc3b66b8 100644 --- a/projects/skia/project.yaml +++ b/projects/skia/project.yaml @@ -21,6 +21,10 @@ sanitizers: - address - undefined - memory +fuzzing_engines: + - afl + - honggfuzz + - libfuzzer help_url: "https://skia.org/dev/testing/fuzz" builds_per_day: 4 main_repo: 'https://skia.googlesource.com/skia.git' diff --git a/projects/sound-open-firmware/project.yaml b/projects/sound-open-firmware/project.yaml index 5f8f889f0877..cf9e7769f9ff 100644 --- a/projects/sound-open-firmware/project.yaml +++ b/projects/sound-open-firmware/project.yaml @@ -8,4 +8,8 @@ auto_ccs: - "sathyanarayana.nujella@intel.corp-partner.google.com" - "adrian.bonislawski@intel.com" - "michal.wasko@intel.com" +fuzzing_engines: + - afl + - honggfuzz + - libfuzzer main_repo: "https://github.com/thesofproject/sof" diff --git a/projects/spdk/project.yaml b/projects/spdk/project.yaml index 396218256efb..5cc480164c02 100644 --- a/projects/spdk/project.yaml +++ b/projects/spdk/project.yaml @@ -11,3 +11,7 @@ sanitizers: - address - undefined - memory +fuzzing_engines: + - afl + - honggfuzz + - libfuzzer diff --git a/projects/suricata/project.yaml b/projects/suricata/project.yaml index cd9e9e5c73d4..e1ad51cf194c 100644 --- a/projects/suricata/project.yaml +++ b/projects/suricata/project.yaml @@ -8,4 +8,8 @@ sanitizers: - address - memory - undefined +fuzzing_engines: + - afl + - honggfuzz + - libfuzzer main_repo: 'https://github.com/OISF/suricata.git' From a422abffd6efed4b30c507cd837eba27e61ca58b Mon Sep 17 00:00:00 2001 From: Jonathan Metzman Date: Tue, 7 Feb 2023 11:47:48 -0500 Subject: [PATCH 05/16] disable centipede for ffmpeg --- projects/ffmpeg/project.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/projects/ffmpeg/project.yaml b/projects/ffmpeg/project.yaml index bb7747a0d52c..fe510402f4f1 100644 --- a/projects/ffmpeg/project.yaml +++ b/projects/ffmpeg/project.yaml @@ -12,5 +12,9 @@ auto_ccs: - "twsmith@mozilla.com" - "kempfjb@gmail.com" - "jordyzomer@google.com" +fuzzing_engines: + - afl + - honggfuzz + - libfuzzer selective_unpack: true main_repo: 'https://git.ffmpeg.org/ffmpeg.git' From 455fa2b005d30d32145701f0bf3feb7d57117977 Mon Sep 17 00:00:00 2001 From: Jonathan Metzman Date: Tue, 7 Feb 2023 12:02:07 -0500 Subject: [PATCH 06/16] Fix skia build --- projects/skia/build.sh | 2 ++ projects/skia/project.yaml | 4 ---- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/projects/skia/build.sh b/projects/skia/build.sh index 4b781730c5bd..aecbcf262e36 100644 --- a/projects/skia/build.sh +++ b/projects/skia/build.sh @@ -41,6 +41,8 @@ elif [ $SANITIZER == "coverage" ]; then CMAKE_SANITIZER="SWIFTSHADER_EMIT_COVERAGE" elif [ $SANITIZER == "thread" ]; then CMAKE_SANITIZER="SWIFTSHADER_UBSAN_DISABLED" +elif [ $SANITIZER == "none" ]; then + CMAKE_SANITIZER="SWIFTSHADER_UBSAN_DISABLED" else exit 1 fi diff --git a/projects/skia/project.yaml b/projects/skia/project.yaml index 8c2cdc3b66b8..bc7b6c6c76de 100644 --- a/projects/skia/project.yaml +++ b/projects/skia/project.yaml @@ -21,10 +21,6 @@ sanitizers: - address - undefined - memory -fuzzing_engines: - - afl - - honggfuzz - - libfuzzer help_url: "https://skia.org/dev/testing/fuzz" builds_per_day: 4 main_repo: 'https://skia.googlesource.com/skia.git' From 847e536fe65f797b38748c2ad3671620ec75d230 Mon Sep 17 00:00:00 2001 From: Jonathan Metzman Date: Tue, 7 Feb 2023 12:36:18 -0500 Subject: [PATCH 07/16] Fix tests --- infra/build/functions/build_project_test.py | 36 -- .../test_data/expected_build_steps.json | 282 ++++++++++++++++ .../expected_centipede_build_steps.json | 316 ------------------ 3 files changed, 282 insertions(+), 352 deletions(-) delete mode 100644 infra/build/functions/test_data/expected_centipede_build_steps.json diff --git a/infra/build/functions/build_project_test.py b/infra/build/functions/build_project_test.py index 91be5793a830..0da901f4f0f1 100644 --- a/infra/build/functions/build_project_test.py +++ b/infra/build/functions/build_project_test.py @@ -75,42 +75,6 @@ def test_get_build_steps(self, mock_url, mock_get_datetime_now): config) self.assertEqual(build_steps, expected_build_steps) - @mock.patch('build_lib.get_signed_url', return_value='test_url') - @mock.patch('build_project.get_datetime_now', - return_value=test_utils.FAKE_DATETIME) - def test_get_centipede_build_steps(self, mock_url, mock_get_datetime_now): - """Test for get_build_steps of centipede.""" - del mock_url, mock_get_datetime_now - # The none sanitizer should be added automatically when other sanitizers are - # specified by the users. - project_yaml_contents = ( - 'language: c++\n' - 'fuzzing_engines:\n' - ' - centipede\n' - 'sanitizers:\n' - ' - address\n' - 'architectures:\n' - ' - x86_64\n' - 'main_repo: https://github.com/google/centipede.git\n') - self.fs.create_dir(test_utils.PROJECT_DIR) - test_utils.create_project_data(test_utils.PROJECT, project_yaml_contents) - - expected_build_steps_file_path = test_utils.get_test_data_file_path( - 'expected_centipede_build_steps.json') - self.fs.add_real_file(expected_build_steps_file_path) - with open(expected_build_steps_file_path) as expected_build_steps_file: - expected_build_steps = json.load(expected_build_steps_file) - - config = build_project.Config(upload=True) - project_yaml, dockerfile = build_project.get_project_data( - test_utils.PROJECT) - build_steps = build_project.get_build_steps(test_utils.PROJECT, - project_yaml, dockerfile, - test_utils.IMAGE_PROJECT, - test_utils.BASE_IMAGES_PROJECT, - config) - self.assertEqual(build_steps, expected_build_steps) - if __name__ == '__main__': unittest.main(exit=False) diff --git a/infra/build/functions/test_data/expected_build_steps.json b/infra/build/functions/test_data/expected_build_steps.json index 37c13e0d0f90..065c76c7bbbf 100644 --- a/infra/build/functions/test_data/expected_build_steps.json +++ b/infra/build/functions/test_data/expected_build_steps.json @@ -213,6 +213,288 @@ "rm -r /workspace/out/afl-address-x86_64" ] }, + { + "name": "gcr.io/cloud-builders/docker", + "env": [ + "ARCHITECTURE=x86_64", + "FUZZING_ENGINE=centipede", + "FUZZING_LANGUAGE=c++", + "HOME=/root", + "OUT=/workspace/out/centipede-address-x86_64", + "SANITIZER=address" + ], + "args": [ + "run", + "--platform", + "linux/amd64", + "-v", + "/workspace:/workspace", + "--privileged", + "--cap-add=all", + "-e", + "ARCHITECTURE=x86_64", + "-e", + "FUZZING_ENGINE=centipede", + "-e", + "FUZZING_LANGUAGE=c++", + "-e", + "HOME=/root", + "-e", + "OUT=/workspace/out/centipede-address-x86_64", + "-e", + "SANITIZER=address", + "-t", + "gcr.io/oss-fuzz/test-project", + "bash", + "-c", + "rm -r /out && cd /src && cd /src && mkdir -p /workspace/out/centipede-address-x86_64 && compile || (echo \"********************************************************************************\nFailed to build.\nTo reproduce, run:\npython infra/helper.py build_image test-project\npython infra/helper.py build_fuzzers --sanitizer address --engine centipede --architecture x86_64 test-project\n********************************************************************************\" && false)" + ], + "id": "compile-centipede-address-x86_64" + }, + { + "name": "gcr.io/cloud-builders/docker", + "env": [ + "ARCHITECTURE=x86_64", + "FUZZING_ENGINE=centipede", + "FUZZING_LANGUAGE=c++", + "HOME=/root", + "OUT=/workspace/out/centipede-address-x86_64", + "SANITIZER=address" + ], + "args": [ + "run", + "--platform", + "linux/amd64", + "-v", + "/workspace:/workspace", + "--privileged", + "--cap-add=all", + "-e", + "ARCHITECTURE=x86_64", + "-e", + "FUZZING_ENGINE=centipede", + "-e", + "FUZZING_LANGUAGE=c++", + "-e", + "HOME=/root", + "-e", + "OUT=/workspace/out/centipede-address-x86_64", + "-e", + "SANITIZER=address", + "-t", + "gcr.io/oss-fuzz-base/base-runner", + "bash", + "-c", + "test_all.py || (echo \"********************************************************************************\nBuild checks failed.\nTo reproduce, run:\npython infra/helper.py build_image test-project\npython infra/helper.py build_fuzzers --sanitizer address --engine centipede --architecture x86_64 test-project\npython infra/helper.py check_build --sanitizer address --engine centipede --architecture x86_64 test-project\n********************************************************************************\" && false)" + ], + "id": "build-check-centipede-address-x86_64" + }, + { + "name": "gcr.io/oss-fuzz-base/base-runner", + "env": [ + "ARCHITECTURE=x86_64", + "FUZZING_ENGINE=centipede", + "FUZZING_LANGUAGE=c++", + "HOME=/root", + "OUT=/workspace/out/centipede-address-x86_64", + "SANITIZER=address" + ], + "args": [ + "bash", + "-c", + "targets_list > /workspace/targets.list.address" + ] + }, + { + "name": "gcr.io/oss-fuzz/test-project", + "args": [ + "bash", + "-c", + "cd /workspace/out/centipede-address-x86_64 && zip -r test-project-address-202001010000.zip *" + ] + }, + { + "name": "gcr.io/oss-fuzz-base/uploader", + "args": [ + "/workspace/srcmap.json", + "test_url" + ] + }, + { + "name": "gcr.io/oss-fuzz-base/uploader", + "args": [ + "/workspace/out/centipede-address-x86_64/test-project-address-202001010000.zip", + "test_url" + ] + }, + { + "name": "gcr.io/oss-fuzz-base/uploader", + "args": [ + "/workspace/targets.list.address", + "test_url" + ] + }, + { + "name": "gcr.io/cloud-builders/curl", + "args": [ + "-H", + "Content-Type: text/plain", + "-X", + "PUT", + "-d", + "test-project-address-202001010000.zip", + "test_url" + ] + }, + { + "name": "gcr.io/oss-fuzz/test-project", + "args": [ + "bash", + "-c", + "rm -r /workspace/out/centipede-address-x86_64" + ] + }, + { + "name": "gcr.io/cloud-builders/docker", + "env": [ + "ARCHITECTURE=x86_64", + "FUZZING_ENGINE=centipede", + "FUZZING_LANGUAGE=c++", + "HOME=/root", + "OUT=/workspace/out/centipede-none-x86_64", + "SANITIZER=none" + ], + "args": [ + "run", + "--platform", + "linux/amd64", + "-v", + "/workspace:/workspace", + "--privileged", + "--cap-add=all", + "-e", + "ARCHITECTURE=x86_64", + "-e", + "FUZZING_ENGINE=centipede", + "-e", + "FUZZING_LANGUAGE=c++", + "-e", + "HOME=/root", + "-e", + "OUT=/workspace/out/centipede-none-x86_64", + "-e", + "SANITIZER=none", + "-t", + "gcr.io/oss-fuzz/test-project", + "bash", + "-c", + "rm -r /out && cd /src && cd /src && mkdir -p /workspace/out/centipede-none-x86_64 && compile || (echo \"********************************************************************************\nFailed to build.\nTo reproduce, run:\npython infra/helper.py build_image test-project\npython infra/helper.py build_fuzzers --sanitizer none --engine centipede --architecture x86_64 test-project\n********************************************************************************\" && false)" + ], + "id": "compile-centipede-none-x86_64" + }, + { + "name": "gcr.io/cloud-builders/docker", + "env": [ + "ARCHITECTURE=x86_64", + "FUZZING_ENGINE=centipede", + "FUZZING_LANGUAGE=c++", + "HOME=/root", + "OUT=/workspace/out/centipede-none-x86_64", + "SANITIZER=none" + ], + "args": [ + "run", + "--platform", + "linux/amd64", + "-v", + "/workspace:/workspace", + "--privileged", + "--cap-add=all", + "-e", + "ARCHITECTURE=x86_64", + "-e", + "FUZZING_ENGINE=centipede", + "-e", + "FUZZING_LANGUAGE=c++", + "-e", + "HOME=/root", + "-e", + "OUT=/workspace/out/centipede-none-x86_64", + "-e", + "SANITIZER=none", + "-t", + "gcr.io/oss-fuzz-base/base-runner", + "bash", + "-c", + "test_all.py || (echo \"********************************************************************************\nBuild checks failed.\nTo reproduce, run:\npython infra/helper.py build_image test-project\npython infra/helper.py build_fuzzers --sanitizer none --engine centipede --architecture x86_64 test-project\npython infra/helper.py check_build --sanitizer none --engine centipede --architecture x86_64 test-project\n********************************************************************************\" && false)" + ], + "id": "build-check-centipede-none-x86_64" + }, + { + "name": "gcr.io/oss-fuzz-base/base-runner", + "env": [ + "ARCHITECTURE=x86_64", + "FUZZING_ENGINE=centipede", + "FUZZING_LANGUAGE=c++", + "HOME=/root", + "OUT=/workspace/out/centipede-none-x86_64", + "SANITIZER=none" + ], + "args": [ + "bash", + "-c", + "targets_list > /workspace/targets.list.none" + ] + }, + { + "name": "gcr.io/oss-fuzz/test-project", + "args": [ + "bash", + "-c", + "cd /workspace/out/centipede-none-x86_64 && zip -r test-project-none-202001010000.zip *" + ] + }, + { + "name": "gcr.io/oss-fuzz-base/uploader", + "args": [ + "/workspace/srcmap.json", + "test_url" + ] + }, + { + "name": "gcr.io/oss-fuzz-base/uploader", + "args": [ + "/workspace/out/centipede-none-x86_64/test-project-none-202001010000.zip", + "test_url" + ] + }, + { + "name": "gcr.io/oss-fuzz-base/uploader", + "args": [ + "/workspace/targets.list.none", + "test_url" + ] + }, + { + "name": "gcr.io/cloud-builders/curl", + "args": [ + "-H", + "Content-Type: text/plain", + "-X", + "PUT", + "-d", + "test-project-none-202001010000.zip", + "test_url" + ] + }, + { + "name": "gcr.io/oss-fuzz/test-project", + "args": [ + "bash", + "-c", + "rm -r /workspace/out/centipede-none-x86_64" + ] + }, { "name": "gcr.io/cloud-builders/docker", "env": [ diff --git a/infra/build/functions/test_data/expected_centipede_build_steps.json b/infra/build/functions/test_data/expected_centipede_build_steps.json deleted file mode 100644 index db92d885ec2d..000000000000 --- a/infra/build/functions/test_data/expected_centipede_build_steps.json +++ /dev/null @@ -1,316 +0,0 @@ -[ - { - "args": [ - "clone", - "https://github.com/google/oss-fuzz.git", - "--depth", - "1" - ], - "name": "gcr.io/cloud-builders/git" - }, - { - "name": "gcr.io/cloud-builders/docker", - "args": [ - "build", - "--tag", - "gcr.io/oss-fuzz/test-project", - "." - ], - "dir": "oss-fuzz/projects/test-project" - }, - { - "name": "gcr.io/oss-fuzz/test-project", - "args": [ - "bash", - "-c", - "srcmap > /workspace/srcmap.json && cat /workspace/srcmap.json" - ], - "env": [ - "OSSFUZZ_REVISION=$REVISION_ID", - "FUZZING_LANGUAGE=c++" - ], - "id": "srcmap" - }, - { - "name": "gcr.io/cloud-builders/docker", - "env": [ - "ARCHITECTURE=x86_64", - "FUZZING_ENGINE=centipede", - "FUZZING_LANGUAGE=c++", - "HOME=/root", - "OUT=/workspace/out/centipede-address-x86_64", - "SANITIZER=address" - ], - "args": [ - "run", - "--platform", - "linux/amd64", - "-v", - "/workspace:/workspace", - "--privileged", - "--cap-add=all", - "-e", - "ARCHITECTURE=x86_64", - "-e", - "FUZZING_ENGINE=centipede", - "-e", - "FUZZING_LANGUAGE=c++", - "-e", - "HOME=/root", - "-e", - "OUT=/workspace/out/centipede-address-x86_64", - "-e", - "SANITIZER=address", - "-t", - "gcr.io/oss-fuzz/test-project", - "bash", - "-c", - "rm -r /out && cd /src && cd /src && mkdir -p /workspace/out/centipede-address-x86_64 && compile || (echo \"********************************************************************************\nFailed to build.\nTo reproduce, run:\npython infra/helper.py build_image test-project\npython infra/helper.py build_fuzzers --sanitizer address --engine centipede --architecture x86_64 test-project\n********************************************************************************\" && false)" - ], - "id": "compile-centipede-address-x86_64" - }, - { - "name": "gcr.io/cloud-builders/docker", - "env": [ - "ARCHITECTURE=x86_64", - "FUZZING_ENGINE=centipede", - "FUZZING_LANGUAGE=c++", - "HOME=/root", - "OUT=/workspace/out/centipede-address-x86_64", - "SANITIZER=address" - ], - "args": [ - "run", - "--platform", - "linux/amd64", - "-v", - "/workspace:/workspace", - "--privileged", - "--cap-add=all", - "-e", - "ARCHITECTURE=x86_64", - "-e", - "FUZZING_ENGINE=centipede", - "-e", - "FUZZING_LANGUAGE=c++", - "-e", - "HOME=/root", - "-e", - "OUT=/workspace/out/centipede-address-x86_64", - "-e", - "SANITIZER=address", - "-t", - "gcr.io/oss-fuzz-base/base-runner", - "bash", - "-c", - "test_all.py || (echo \"********************************************************************************\nBuild checks failed.\nTo reproduce, run:\npython infra/helper.py build_image test-project\npython infra/helper.py build_fuzzers --sanitizer address --engine centipede --architecture x86_64 test-project\npython infra/helper.py check_build --sanitizer address --engine centipede --architecture x86_64 test-project\n********************************************************************************\" && false)" - ], - "id": "build-check-centipede-address-x86_64" - }, - { - "name": "gcr.io/oss-fuzz-base/base-runner", - "env": [ - "ARCHITECTURE=x86_64", - "FUZZING_ENGINE=centipede", - "FUZZING_LANGUAGE=c++", - "HOME=/root", - "OUT=/workspace/out/centipede-address-x86_64", - "SANITIZER=address" - ], - "args": [ - "bash", - "-c", - "targets_list > /workspace/targets.list.address" - ] - }, - { - "name": "gcr.io/oss-fuzz/test-project", - "args": [ - "bash", - "-c", - "cd /workspace/out/centipede-address-x86_64 && zip -r test-project-address-202001010000.zip *" - ] - }, - { - "name": "gcr.io/oss-fuzz-base/uploader", - "args": [ - "/workspace/srcmap.json", - "test_url" - ] - }, - { - "name": "gcr.io/oss-fuzz-base/uploader", - "args": [ - "/workspace/out/centipede-address-x86_64/test-project-address-202001010000.zip", - "test_url" - ] - }, - { - "name": "gcr.io/oss-fuzz-base/uploader", - "args": [ - "/workspace/targets.list.address", - "test_url" - ] - }, - { - "name": "gcr.io/cloud-builders/curl", - "args": [ - "-H", - "Content-Type: text/plain", - "-X", - "PUT", - "-d", - "test-project-address-202001010000.zip", - "test_url" - ] - }, - { - "name": "gcr.io/oss-fuzz/test-project", - "args": [ - "bash", - "-c", - "rm -r /workspace/out/centipede-address-x86_64" - ] - }, - { - "name": "gcr.io/cloud-builders/docker", - "env": [ - "ARCHITECTURE=x86_64", - "FUZZING_ENGINE=centipede", - "FUZZING_LANGUAGE=c++", - "HOME=/root", - "OUT=/workspace/out/centipede-none-x86_64", - "SANITIZER=none" - ], - "args": [ - "run", - "--platform", - "linux/amd64", - "-v", - "/workspace:/workspace", - "--privileged", - "--cap-add=all", - "-e", - "ARCHITECTURE=x86_64", - "-e", - "FUZZING_ENGINE=centipede", - "-e", - "FUZZING_LANGUAGE=c++", - "-e", - "HOME=/root", - "-e", - "OUT=/workspace/out/centipede-none-x86_64", - "-e", - "SANITIZER=none", - "-t", - "gcr.io/oss-fuzz/test-project", - "bash", - "-c", - "rm -r /out && cd /src && cd /src && mkdir -p /workspace/out/centipede-none-x86_64 && compile || (echo \"********************************************************************************\nFailed to build.\nTo reproduce, run:\npython infra/helper.py build_image test-project\npython infra/helper.py build_fuzzers --sanitizer none --engine centipede --architecture x86_64 test-project\n********************************************************************************\" && false)" - ], - "id": "compile-centipede-none-x86_64" - }, - { - "name": "gcr.io/cloud-builders/docker", - "env": [ - "ARCHITECTURE=x86_64", - "FUZZING_ENGINE=centipede", - "FUZZING_LANGUAGE=c++", - "HOME=/root", - "OUT=/workspace/out/centipede-none-x86_64", - "SANITIZER=none" - ], - "args": [ - "run", - "--platform", - "linux/amd64", - "-v", - "/workspace:/workspace", - "--privileged", - "--cap-add=all", - "-e", - "ARCHITECTURE=x86_64", - "-e", - "FUZZING_ENGINE=centipede", - "-e", - "FUZZING_LANGUAGE=c++", - "-e", - "HOME=/root", - "-e", - "OUT=/workspace/out/centipede-none-x86_64", - "-e", - "SANITIZER=none", - "-t", - "gcr.io/oss-fuzz-base/base-runner", - "bash", - "-c", - "test_all.py || (echo \"********************************************************************************\nBuild checks failed.\nTo reproduce, run:\npython infra/helper.py build_image test-project\npython infra/helper.py build_fuzzers --sanitizer none --engine centipede --architecture x86_64 test-project\npython infra/helper.py check_build --sanitizer none --engine centipede --architecture x86_64 test-project\n********************************************************************************\" && false)" - ], - "id": "build-check-centipede-none-x86_64" - }, - { - "name": "gcr.io/oss-fuzz-base/base-runner", - "env": [ - "ARCHITECTURE=x86_64", - "FUZZING_ENGINE=centipede", - "FUZZING_LANGUAGE=c++", - "HOME=/root", - "OUT=/workspace/out/centipede-none-x86_64", - "SANITIZER=none" - ], - "args": [ - "bash", - "-c", - "targets_list > /workspace/targets.list.none" - ] - }, - { - "name": "gcr.io/oss-fuzz/test-project", - "args": [ - "bash", - "-c", - "cd /workspace/out/centipede-none-x86_64 && zip -r test-project-none-202001010000.zip *" - ] - }, - { - "name": "gcr.io/oss-fuzz-base/uploader", - "args": [ - "/workspace/srcmap.json", - "test_url" - ] - }, - { - "name": "gcr.io/oss-fuzz-base/uploader", - "args": [ - "/workspace/out/centipede-none-x86_64/test-project-none-202001010000.zip", - "test_url" - ] - }, - { - "name": "gcr.io/oss-fuzz-base/uploader", - "args": [ - "/workspace/targets.list.none", - "test_url" - ] - }, - { - "name": "gcr.io/cloud-builders/curl", - "args": [ - "-H", - "Content-Type: text/plain", - "-X", - "PUT", - "-d", - "test-project-none-202001010000.zip", - "test_url" - ] - }, - { - "name": "gcr.io/oss-fuzz/test-project", - "args": [ - "bash", - "-c", - "rm -r /workspace/out/centipede-none-x86_64" - ] - } -] From 2c0ac0b3faf0b94b8051d9e2e0e9ec7d75ef0b08 Mon Sep 17 00:00:00 2001 From: Jonathan Metzman Date: Tue, 7 Feb 2023 14:31:34 -0500 Subject: [PATCH 08/16] disable wget --- projects/wget/project.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/projects/wget/project.yaml b/projects/wget/project.yaml index 367bda9b1fda..fb666459c973 100644 --- a/projects/wget/project.yaml +++ b/projects/wget/project.yaml @@ -5,4 +5,8 @@ auto_ccs: - "tim.ruehsen@gmx.de" - "darnir@gmail.com" - "gscrivan@redhat.com" +fuzzing_engines: + - "afl" + - "honggfuzz" + - "libfuzzer" main_repo: 'https://git.savannah.gnu.org/git/wget.git' From cde040d3f5450a079bf8c04d52287f49008efb53 Mon Sep 17 00:00:00 2001 From: Jonathan Metzman Date: Tue, 7 Feb 2023 15:05:07 -0500 Subject: [PATCH 09/16] Disable broken --- projects/cras/project.yaml | 4 ++++ projects/fluent-bit/project.yaml | 4 ++++ projects/gdbm/build.sh | 2 +- projects/gdbm/project.yaml | 4 ++++ projects/karchive/project.yaml | 6 +++++- projects/kcodecs/project.yaml | 6 +++++- projects/kimageformats/project.yaml | 4 ++++ projects/libpsl/project.yaml | 4 ++++ projects/libvnc/project.yaml | 4 ++++ projects/lua/project.yaml | 4 ++++ projects/net-snmp/project.yaml | 4 ++++ projects/netcdf/project.yaml | 4 ++++ projects/opensc/project.yaml | 4 ++++ projects/opensips/project.yaml | 4 ++++ projects/php/project.yaml | 4 ++++ projects/poppler/project.yaml | 4 ++++ projects/proftpd/project.yaml | 4 ++++ projects/spdk/build.sh | 2 +- projects/tpm2-tss/project.yaml | 6 +++++- projects/varnish/project.yaml | 4 ++++ 20 files changed, 77 insertions(+), 5 deletions(-) diff --git a/projects/cras/project.yaml b/projects/cras/project.yaml index 62d3cf9b2e43..dc560420e324 100644 --- a/projects/cras/project.yaml +++ b/projects/cras/project.yaml @@ -19,5 +19,9 @@ sanitizers: - address - memory - undefined +fuzzing_engines: + - afl + - honggfuzz + - libfuzzer builds_per_day: 4 main_repo: 'https://chromium.googlesource.com/chromiumos/third_party/adhd' diff --git a/projects/fluent-bit/project.yaml b/projects/fluent-bit/project.yaml index 968e23a0df1a..094ece0e950d 100755 --- a/projects/fluent-bit/project.yaml +++ b/projects/fluent-bit/project.yaml @@ -6,3 +6,7 @@ auto_ccs: - "wppttt@amazon.com" - "zh0512xx@gmail.com" main_repo: 'https://github.com/fluent/fluent-bit/' +fuzzing_engines: + - afl + - honggfuzz + - libfuzzer diff --git a/projects/gdbm/build.sh b/projects/gdbm/build.sh index 3d00db473cf1..5e23fb5dd98c 100644 --- a/projects/gdbm/build.sh +++ b/projects/gdbm/build.sh @@ -23,7 +23,7 @@ make -j$(nproc) all # Build fuzzer cd fuzz $CC $CFLAGS -c -I.. -I../src -I../tools -ogdbm_fuzzer.o gdbm_fuzzer.c -$CXX $CFLAGS -ogdbm_fuzzer gdbm_fuzzer.o ../tools/libgdbmapp.a ../src/.libs/libgdbm.a $LIB_FUZZING_ENGINE +$CXX $CXXFLAGS -ogdbm_fuzzer gdbm_fuzzer.o ../tools/libgdbmapp.a ../src/.libs/libgdbm.a $LIB_FUZZING_ENGINE cp gdbm_fuzzer $OUT cp gdbm_fuzzer.rc $OUT diff --git a/projects/gdbm/project.yaml b/projects/gdbm/project.yaml index 2169eeabfbc2..fdf5fe573235 100644 --- a/projects/gdbm/project.yaml +++ b/projects/gdbm/project.yaml @@ -4,3 +4,7 @@ primary_contact: "sergey.poznyakoff@gmail.com" auto_ccs: - "gray@gnu.org" main_repo: "https://git.gnu.org.ua/gdbm.git" +fuzzing_engines: + - afl + - honggfuzz + - libfuzzer diff --git a/projects/karchive/project.yaml b/projects/karchive/project.yaml index 2318ce54070f..db73eb1cc1f9 100644 --- a/projects/karchive/project.yaml +++ b/projects/karchive/project.yaml @@ -6,4 +6,8 @@ sanitizers: # Disabled MSAN because of https://github.com/google/oss-fuzz/issues/6294 # - memory - undefined -main_repo: 'https://invent.kde.org/frameworks/karchive.git' \ No newline at end of file +main_repo: 'https://invent.kde.org/frameworks/karchive.git' +fuzzing_engines: + - afl + - honggfuzz + - libfuzzer diff --git a/projects/kcodecs/project.yaml b/projects/kcodecs/project.yaml index b698f63205d4..5fbc728f2642 100644 --- a/projects/kcodecs/project.yaml +++ b/projects/kcodecs/project.yaml @@ -6,4 +6,8 @@ sanitizers: # Disabled MSAN because of https://github.com/google/oss-fuzz/issues/6294 # - memory - undefined -main_repo: 'https://invent.kde.org/frameworks/kcodecs.git' \ No newline at end of file +main_repo: 'https://invent.kde.org/frameworks/kcodecs.git' +fuzzing_engines: + - afl + - honggfuzz + - libfuzzer diff --git a/projects/kimageformats/project.yaml b/projects/kimageformats/project.yaml index f9f80257ca08..9d3b82ca3983 100644 --- a/projects/kimageformats/project.yaml +++ b/projects/kimageformats/project.yaml @@ -9,3 +9,7 @@ sanitizers: main_repo: 'https://invent.kde.org/frameworks/kimageformats.git' auto_ccs: - dnovomesky@gmail.com +fuzzing_engines: + - afl + - honggfuzz + - libfuzzer diff --git a/projects/libpsl/project.yaml b/projects/libpsl/project.yaml index ea3a97919c95..f33f9e5f99d2 100644 --- a/projects/libpsl/project.yaml +++ b/projects/libpsl/project.yaml @@ -4,3 +4,7 @@ primary_contact: "rockdaboot@gmail.com" auto_ccs: - "tim.ruehsen@gmx.de" main_repo: 'https://github.com/rockdaboot/libpsl.git' +fuzzing_engines: + - afl + - honggfuzz + - libfuzzer diff --git a/projects/libvnc/project.yaml b/projects/libvnc/project.yaml index 14182e5b44c0..cd5ff571dece 100644 --- a/projects/libvnc/project.yaml +++ b/projects/libvnc/project.yaml @@ -6,3 +6,7 @@ auto_ccs: - "info@christianbeier.net" - "christian.cb.beier@gmail.com" main_repo: 'https://github.com/LibVNC/libvncserver.git' +fuzzing_engines: + - afl + - honggfuzz + - libfuzzer diff --git a/projects/lua/project.yaml b/projects/lua/project.yaml index 9a4b0dd3a5e4..5cdd14078ca0 100644 --- a/projects/lua/project.yaml +++ b/projects/lua/project.yaml @@ -5,3 +5,7 @@ auto_ccs: - "fuzz@lua.org" - "david@adalogics.com" main_repo: 'https://github.com/lua/lua' +fuzzing_engines: + - afl + - honggfuzz + - libfuzzer diff --git a/projects/net-snmp/project.yaml b/projects/net-snmp/project.yaml index 5a27e2e7cbd1..7921811e620e 100644 --- a/projects/net-snmp/project.yaml +++ b/projects/net-snmp/project.yaml @@ -8,3 +8,7 @@ auto_ccs: - "magfr@lysator.liu.se" - "david@adalogics.com" main_repo: 'git://git.code.sf.net/p/net-snmp/code' +fuzzing_engines: + - afl + - honggfuzz + - libfuzzer diff --git a/projects/netcdf/project.yaml b/projects/netcdf/project.yaml index 794e5cbd2350..d81fcbe284f3 100644 --- a/projects/netcdf/project.yaml +++ b/projects/netcdf/project.yaml @@ -9,3 +9,7 @@ sanitizers: - address - undefined main_repo: 'https://github.com/Unidata/netcdf-c' +fuzzing_engines: + - afl + - honggfuzz + - libfuzzer diff --git a/projects/opensc/project.yaml b/projects/opensc/project.yaml index 03360d84d678..c45b82f7e4c1 100644 --- a/projects/opensc/project.yaml +++ b/projects/opensc/project.yaml @@ -10,3 +10,7 @@ auto_ccs: - "jakuje@gmail.com" - "xhanulik@gmail.com" main_repo: 'https://github.com/OpenSC/OpenSC' +fuzzing_engines: + - afl + - honggfuzz + - libfuzzer diff --git a/projects/opensips/project.yaml b/projects/opensips/project.yaml index a4e11848223b..51564cc5f7b8 100755 --- a/projects/opensips/project.yaml +++ b/projects/opensips/project.yaml @@ -8,3 +8,7 @@ auto_ccs: - "bogdan.andrei.iancu@gmail.com" - "rvlad.patrascu@gmail.com" - "razvan.crainea@gmail.com" +fuzzing_engines: + - afl + - honggfuzz + - libfuzzer diff --git a/projects/php/project.yaml b/projects/php/project.yaml index 817c31a439ae..a70046438a6e 100644 --- a/projects/php/project.yaml +++ b/projects/php/project.yaml @@ -5,6 +5,10 @@ auto_ccs: - "smalyshev@gmail.com" - "nikita.ppv@gmail.com" - "dmitrystogov@gmail.com" +fuzzing_engines: + - "afl" + - "honggfuzz" + - "libfuzzer" sanitizers: - address - undefined diff --git a/projects/poppler/project.yaml b/projects/poppler/project.yaml index c12379633243..5a73b157c562 100644 --- a/projects/poppler/project.yaml +++ b/projects/poppler/project.yaml @@ -5,6 +5,10 @@ sanitizers: - address - memory - undefined +fuzzing_engines: + - afl + - honggfuzz + - libfuzzer auto_ccs: - jonathan@titanous.com - adam.reichold@t-online.de diff --git a/projects/proftpd/project.yaml b/projects/proftpd/project.yaml index f3b5317f44bc..d850f87b9f14 100644 --- a/projects/proftpd/project.yaml +++ b/projects/proftpd/project.yaml @@ -7,3 +7,7 @@ auto_ccs: sanitizers: - address - undefined +fuzzing_engines: + - "afl" + - "honggfuzz" + - "libfuzzer" diff --git a/projects/spdk/build.sh b/projects/spdk/build.sh index ada493ab68e3..473780926bae 100755 --- a/projects/spdk/build.sh +++ b/projects/spdk/build.sh @@ -29,4 +29,4 @@ $CXX $CXXFLAGS -I/src/spdk -I/src/spdk/include \ $CXX $CXXFLAGS $LIB_FUZZING_ENGINE \ parse_json_fuzzer.o -o $OUT/parse_json_fuzzer \ /src/spdk/build/lib/libspdk_env_dpdk.a \ - /src/spdk/build/lib/libspdk_json.a + /src/spdk/build/lib/libspdk_json.a diff --git a/projects/tpm2-tss/project.yaml b/projects/tpm2-tss/project.yaml index 7ac01a9679f3..3ecea0948049 100644 --- a/projects/tpm2-tss/project.yaml +++ b/projects/tpm2-tss/project.yaml @@ -4,9 +4,13 @@ primary_contact: "william.c.roberts@intel.com" auto_ccs: - "andreas.fuchs@sit.fraunhofer.de" - "tstruk@gmail.com" +fuzzing_engines: + - "afl" + - "honggfuzz" + - "libfuzzer" sanitizers: - address # Disabled MSAN because of https://github.com/google/oss-fuzz/issues/6294 # - memory - undefined -main_repo: 'https://github.com/tstruk/tpm2-tss.git' \ No newline at end of file +main_repo: 'https://github.com/tstruk/tpm2-tss.git' diff --git a/projects/varnish/project.yaml b/projects/varnish/project.yaml index d25135569505..ecdc2ecbaf7b 100644 --- a/projects/varnish/project.yaml +++ b/projects/varnish/project.yaml @@ -6,3 +6,7 @@ auto_ccs: - "nils.goroll@uplex.de" - "martin@varnish-software.com" main_repo: 'https://github.com/varnishcache/varnish-cache' +fuzzing_engines: + - "afl" + - "honggfuzz" + - "libfuzzer" From 8879475a061bd637440e67358ed2754ce45bcdf5 Mon Sep 17 00:00:00 2001 From: Jonathan Metzman Date: Tue, 7 Feb 2023 16:18:15 -0500 Subject: [PATCH 10/16] disable --- projects/lxc/project.yaml | 4 ++++ projects/pigweed/project.yaml | 4 ++++ projects/utf8proc/project.yaml | 7 +++++-- projects/vlc/project.yaml | 4 ++++ 4 files changed, 17 insertions(+), 2 deletions(-) diff --git a/projects/lxc/project.yaml b/projects/lxc/project.yaml index f19d3563af95..cd0a2176651a 100644 --- a/projects/lxc/project.yaml +++ b/projects/lxc/project.yaml @@ -10,3 +10,7 @@ auto_ccs: - stgraber@stgraber.org - evverx@gmail.com main_repo: "https://github.com/lxc/lxc" +fuzzing_engines: + - afl + - honggfuzz + - libfuzzer diff --git a/projects/pigweed/project.yaml b/projects/pigweed/project.yaml index eb598a40e4a9..6614645cc0dd 100644 --- a/projects/pigweed/project.yaml +++ b/projects/pigweed/project.yaml @@ -16,3 +16,7 @@ auto_ccs: sanitizers: - address main_repo: 'https://pigweed.googlesource.com/pigweed/pigweed' +fuzzing_engines: + - afl + - honggfuzz + - libfuzzer diff --git a/projects/utf8proc/project.yaml b/projects/utf8proc/project.yaml index c35bcea9a338..91794763de2b 100644 --- a/projects/utf8proc/project.yaml +++ b/projects/utf8proc/project.yaml @@ -6,6 +6,9 @@ auto_ccs: sanitizers: - address - memory - - undefined + - undefined main_repo: 'https://github.com/JuliaStrings/utf8proc' - +fuzzing_engines: + - afl + - honggfuzz + - libfuzzer diff --git a/projects/vlc/project.yaml b/projects/vlc/project.yaml index 1006c84e7088..3aa97aa955c8 100644 --- a/projects/vlc/project.yaml +++ b/projects/vlc/project.yaml @@ -8,3 +8,7 @@ sanitizers: - address - undefined main_repo: 'https://github.com/videolan/vlc' +fuzzing_engines: + - afl + - honggfuzz + - libfuzzer From 379457a3c108c67dfa0723c92b7b6b47b4feb46e Mon Sep 17 00:00:00 2001 From: Jonathan Metzman Date: Tue, 7 Feb 2023 16:36:30 -0500 Subject: [PATCH 11/16] Disable --- projects/ecc-diff-fuzzer/project.yaml | 5 ++++- projects/lxc/project.yaml | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/projects/ecc-diff-fuzzer/project.yaml b/projects/ecc-diff-fuzzer/project.yaml index d88c040d2c73..6bf15470ab40 100644 --- a/projects/ecc-diff-fuzzer/project.yaml +++ b/projects/ecc-diff-fuzzer/project.yaml @@ -1,7 +1,10 @@ homepage: "https://github.com/catenacyber/elliptic-curve-differential-fuzzer" language: c++ primary_contact: "p.antoine@catenacyber.fr" - +fuzzing_engines: + - afl + - honggfuzz + - libfuzzer architectures: - x86_64 - i386 diff --git a/projects/lxc/project.yaml b/projects/lxc/project.yaml index cd0a2176651a..69820302eab1 100644 --- a/projects/lxc/project.yaml +++ b/projects/lxc/project.yaml @@ -14,3 +14,6 @@ fuzzing_engines: - afl - honggfuzz - libfuzzer + # - centipede + # Don't use centipede because it can't handle fuzz targets with "config" in + # the name. From 27b6bbea110ab9137914069583828b306db5278d Mon Sep 17 00:00:00 2001 From: Jonathan Metzman Date: Tue, 7 Feb 2023 16:53:25 -0500 Subject: [PATCH 12/16] Fix sed cases --- projects/karchive/build.sh | 6 ++++-- projects/kcodecs/build.sh | 6 ++++-- projects/kimageformats/build.sh | 8 +++++--- projects/lua/build.sh | 6 ++++-- 4 files changed, 17 insertions(+), 9 deletions(-) diff --git a/projects/karchive/build.sh b/projects/karchive/build.sh index fd6eb891423f..8ca4ea1d6daf 100644 --- a/projects/karchive/build.sh +++ b/projects/karchive/build.sh @@ -60,8 +60,10 @@ make install -j$(nproc) cd $SRC cd qtbase # add the flags to Qt build too -sed -i -e "s/QMAKE_CXXFLAGS += -stdlib=libc++/QMAKE_CXXFLAGS += -stdlib=libc++ $CXXFLAGS\nQMAKE_CFLAGS += $CFLAGS/g" mkspecs/linux-clang-libc++/qmake.conf -sed -i -e "s/QMAKE_LFLAGS += -stdlib=libc++/QMAKE_LFLAGS += -stdlib=libc++ -lpthread $CXXFLAGS/g" mkspecs/linux-clang-libc++/qmake.conf +# Use ~ as sed delimiters instead of the usual "/" because C(XX)FLAGS may +# contain paths with slashes. +sed -i -e "s~QMAKE_CXXFLAGS += -stdlib=libc++~QMAKE_CXXFLAGS += -stdlib=libc++ $CXXFLAGS\nQMAKE_CFLAGS += $CFLAGS~g" mkspecs/linux-clang-libc++/qmake.conf +sed -i -e "s~QMAKE_LFLAGS += -stdlib=libc++~QMAKE_LFLAGS += -stdlib=libc++ -lpthread $CXXFLAGS~g" mkspecs/linux-clang-libc++/qmake.conf # make qmake compile faster sed -i -e "s/MAKE\")/MAKE\" -j$(nproc))/g" configure # add QT_NO_WARNING_OUTPUT to make the output a bit cleaner by not containing lots of QBuffer::seek: Invalid pos diff --git a/projects/kcodecs/build.sh b/projects/kcodecs/build.sh index a2e9a6f83e3a..ac4b136eb9d0 100644 --- a/projects/kcodecs/build.sh +++ b/projects/kcodecs/build.sh @@ -37,8 +37,10 @@ make install cd $SRC cd qtbase # add the flags to Qt build too -sed -i -e "s/QMAKE_CXXFLAGS += -stdlib=libc++/QMAKE_CXXFLAGS += -stdlib=libc++ $CXXFLAGS\nQMAKE_CFLAGS += $CFLAGS/g" mkspecs/linux-clang-libc++/qmake.conf -sed -i -e "s/QMAKE_LFLAGS += -stdlib=libc++/QMAKE_LFLAGS += -stdlib=libc++ -lpthread $CXXFLAGS/g" mkspecs/linux-clang-libc++/qmake.conf +# Use ~ as sed delimiters instead of the usual "/" because C(XX)FLAGS may +# contain paths with slashes. +sed -i -e "s~QMAKE_CXXFLAGS += -stdlib=libc++~QMAKE_CXXFLAGS += -stdlib=libc++ $CXXFLAGS\nQMAKE_CFLAGS += $CFLAGS~g" mkspecs/linux-clang-libc++/qmake.conf +sed -i -e "s~QMAKE_LFLAGS += -stdlib=libc++~QMAKE_LFLAGS += -stdlib=libc++ -lpthread $CXXFLAGS~g" mkspecs/linux-clang-libc++/qmake.conf # make qmake compile faster sed -i -e "s/MAKE\")/MAKE\" -j$(nproc))/g" configure ./configure --zlib=qt --glib=no --libpng=qt -opensource -confirm-license -static -no-opengl -no-icu -platform linux-clang-libc++ -v diff --git a/projects/kimageformats/build.sh b/projects/kimageformats/build.sh index 62a6712aa567..943caf3335dd 100644 --- a/projects/kimageformats/build.sh +++ b/projects/kimageformats/build.sh @@ -23,7 +23,7 @@ CFLAGS="$CFLAGS -fno-sanitize=function,vptr" CXXFLAGS="$CXXFLAGS -fno-sanitize=function,vptr" autoreconf --install ./configure --disable-examples -make -j$(nproc) +make -j$(nproc) make install -j$(nproc) CFLAGS=$TMP_CFLAGS CXXFLAGS=$TMP_CXXFLAGS @@ -46,8 +46,10 @@ make install -j$(nproc) cd $SRC cd qtbase # add the flags to Qt build too -sed -i -e "s/QMAKE_CXXFLAGS += -stdlib=libc++/QMAKE_CXXFLAGS += -stdlib=libc++ $CXXFLAGS\nQMAKE_CFLAGS += $CFLAGS/g" mkspecs/linux-clang-libc++/qmake.conf -sed -i -e "s/QMAKE_LFLAGS += -stdlib=libc++/QMAKE_LFLAGS += -stdlib=libc++ -lpthread $CXXFLAGS/g" mkspecs/linux-clang-libc++/qmake.conf +# Use ~ as sed delimiters instead of the usual "/" because C(XX)FLAGS may +# contain paths with slashes. +sed -i -e "s~QMAKE_CXXFLAGS += -stdlib=libc++~QMAKE_CXXFLAGS += -stdlib=libc++ $CXXFLAGS\nQMAKE_CFLAGS += $CFLAGS~g" mkspecs/linux-clang-libc++/qmake.conf +sed -i -e "s~QMAKE_LFLAGS += -stdlib=libc++~QMAKE_LFLAGS += -stdlib=libc++ -lpthread $CXXFLAGS~g" mkspecs/linux-clang-libc++/qmake.conf # disable sanitize=vptr for harfbuzz since it compiles without rtti sed -i -e "s/TARGET = qtharfbuzz/TARGET = qtharfbuzz\nQMAKE_CXXFLAGS += -fno-sanitize=vptr/g" src/3rdparty/harfbuzz-ng/harfbuzz-ng.pro # make qmake compile faster diff --git a/projects/lua/build.sh b/projects/lua/build.sh index 72f33c7f93c7..8b21ce1c5409 100755 --- a/projects/lua/build.sh +++ b/projects/lua/build.sh @@ -15,8 +15,10 @@ # ################################################################################ -sed "s/CFLAGS=/CFLAGS+=/g" -i $SRC/lua/makefile -sed "s/MYLDFLAGS=/MYLDFLAGS=${CFLAGS} /g" -i $SRC/lua/makefile +# Use ~ as sed delimiters instead of the usual "/" because C(XX)FLAGS may +# contain paths with slashes. +sed "s~CFLAGS=~CFLAGS+=~g" -i $SRC/lua/makefile +sed "s~MYLDFLAGS=~MYLDFLAGS=${CFLAGS} ~g" -i $SRC/lua/makefile sed "s|CC= gcc|CC= ${CC}|g" -i $SRC/lua/makefile cd $SRC/lua From 2d322e21892d83c880e2a63ca1101784b8359db7 Mon Sep 17 00:00:00 2001 From: Jonathan Metzman Date: Tue, 7 Feb 2023 16:55:51 -0500 Subject: [PATCH 13/16] fix project.yaml --- projects/ecc-diff-fuzzer/project.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/projects/ecc-diff-fuzzer/project.yaml b/projects/ecc-diff-fuzzer/project.yaml index 6bf15470ab40..bb7413709078 100644 --- a/projects/ecc-diff-fuzzer/project.yaml +++ b/projects/ecc-diff-fuzzer/project.yaml @@ -5,6 +5,7 @@ fuzzing_engines: - afl - honggfuzz - libfuzzer +main_repo: https://github.com/catenacyber/elliptic-curve-differential-fuzzer architectures: - x86_64 - i386 From 088ec027f8eca764a7c2c0056f494f80789d8f10 Mon Sep 17 00:00:00 2001 From: Jonathan Metzman Date: Wed, 8 Feb 2023 11:19:38 -0500 Subject: [PATCH 14/16] Don't turn on centipede yet --- infra/build/functions/build_project.py | 6 +- infra/build/functions/build_project_test.py | 36 +++ .../test_data/expected_build_steps.json | 282 ------------------ infra/ci/build.py | 2 +- 4 files changed, 40 insertions(+), 286 deletions(-) diff --git a/infra/build/functions/build_project.py b/infra/build/functions/build_project.py index cbca6c909311..23ec94810f55 100755 --- a/infra/build/functions/build_project.py +++ b/infra/build/functions/build_project.py @@ -42,7 +42,7 @@ GCB_LOGS_BUCKET = 'oss-fuzz-gcb-logs' DEFAULT_ARCHITECTURES = ['x86_64'] -DEFAULT_ENGINES = ['libfuzzer', 'afl', 'honggfuzz', 'centipede'] +DEFAULT_ENGINES = ['libfuzzer', 'afl', 'honggfuzz'] DEFAULT_SANITIZERS = ['address', 'undefined'] LATEST_VERSION_FILENAME = 'latest.version' @@ -118,7 +118,7 @@ def get_sanitizer_strings(sanitizers): return processed_sanitizers -def add_none_sanitizer_for_centipede(project_yaml): +def set_default_sanitizer_for_centipede(project_yaml): """Adds none as a sanitizer for centipede in yaml if it does not exist yet.""" # Centipede requires a separate unsanitized binary to use sanitized ones. if ('centipede' in project_yaml['fuzzing_engines'] and @@ -177,7 +177,7 @@ def set_yaml_defaults(project_yaml): project_yaml.setdefault('labels', {}) # Adds 'none' as a sanitizer for centipede to the project yaml by default, # because Centipede always requires a separate build of unsanitized binary. - add_none_sanitizer_for_centipede(project_yaml) + set_default_sanitizer_for_centipede(project_yaml) def is_supported_configuration(build): diff --git a/infra/build/functions/build_project_test.py b/infra/build/functions/build_project_test.py index 0da901f4f0f1..91be5793a830 100644 --- a/infra/build/functions/build_project_test.py +++ b/infra/build/functions/build_project_test.py @@ -75,6 +75,42 @@ def test_get_build_steps(self, mock_url, mock_get_datetime_now): config) self.assertEqual(build_steps, expected_build_steps) + @mock.patch('build_lib.get_signed_url', return_value='test_url') + @mock.patch('build_project.get_datetime_now', + return_value=test_utils.FAKE_DATETIME) + def test_get_centipede_build_steps(self, mock_url, mock_get_datetime_now): + """Test for get_build_steps of centipede.""" + del mock_url, mock_get_datetime_now + # The none sanitizer should be added automatically when other sanitizers are + # specified by the users. + project_yaml_contents = ( + 'language: c++\n' + 'fuzzing_engines:\n' + ' - centipede\n' + 'sanitizers:\n' + ' - address\n' + 'architectures:\n' + ' - x86_64\n' + 'main_repo: https://github.com/google/centipede.git\n') + self.fs.create_dir(test_utils.PROJECT_DIR) + test_utils.create_project_data(test_utils.PROJECT, project_yaml_contents) + + expected_build_steps_file_path = test_utils.get_test_data_file_path( + 'expected_centipede_build_steps.json') + self.fs.add_real_file(expected_build_steps_file_path) + with open(expected_build_steps_file_path) as expected_build_steps_file: + expected_build_steps = json.load(expected_build_steps_file) + + config = build_project.Config(upload=True) + project_yaml, dockerfile = build_project.get_project_data( + test_utils.PROJECT) + build_steps = build_project.get_build_steps(test_utils.PROJECT, + project_yaml, dockerfile, + test_utils.IMAGE_PROJECT, + test_utils.BASE_IMAGES_PROJECT, + config) + self.assertEqual(build_steps, expected_build_steps) + if __name__ == '__main__': unittest.main(exit=False) diff --git a/infra/build/functions/test_data/expected_build_steps.json b/infra/build/functions/test_data/expected_build_steps.json index 065c76c7bbbf..37c13e0d0f90 100644 --- a/infra/build/functions/test_data/expected_build_steps.json +++ b/infra/build/functions/test_data/expected_build_steps.json @@ -213,288 +213,6 @@ "rm -r /workspace/out/afl-address-x86_64" ] }, - { - "name": "gcr.io/cloud-builders/docker", - "env": [ - "ARCHITECTURE=x86_64", - "FUZZING_ENGINE=centipede", - "FUZZING_LANGUAGE=c++", - "HOME=/root", - "OUT=/workspace/out/centipede-address-x86_64", - "SANITIZER=address" - ], - "args": [ - "run", - "--platform", - "linux/amd64", - "-v", - "/workspace:/workspace", - "--privileged", - "--cap-add=all", - "-e", - "ARCHITECTURE=x86_64", - "-e", - "FUZZING_ENGINE=centipede", - "-e", - "FUZZING_LANGUAGE=c++", - "-e", - "HOME=/root", - "-e", - "OUT=/workspace/out/centipede-address-x86_64", - "-e", - "SANITIZER=address", - "-t", - "gcr.io/oss-fuzz/test-project", - "bash", - "-c", - "rm -r /out && cd /src && cd /src && mkdir -p /workspace/out/centipede-address-x86_64 && compile || (echo \"********************************************************************************\nFailed to build.\nTo reproduce, run:\npython infra/helper.py build_image test-project\npython infra/helper.py build_fuzzers --sanitizer address --engine centipede --architecture x86_64 test-project\n********************************************************************************\" && false)" - ], - "id": "compile-centipede-address-x86_64" - }, - { - "name": "gcr.io/cloud-builders/docker", - "env": [ - "ARCHITECTURE=x86_64", - "FUZZING_ENGINE=centipede", - "FUZZING_LANGUAGE=c++", - "HOME=/root", - "OUT=/workspace/out/centipede-address-x86_64", - "SANITIZER=address" - ], - "args": [ - "run", - "--platform", - "linux/amd64", - "-v", - "/workspace:/workspace", - "--privileged", - "--cap-add=all", - "-e", - "ARCHITECTURE=x86_64", - "-e", - "FUZZING_ENGINE=centipede", - "-e", - "FUZZING_LANGUAGE=c++", - "-e", - "HOME=/root", - "-e", - "OUT=/workspace/out/centipede-address-x86_64", - "-e", - "SANITIZER=address", - "-t", - "gcr.io/oss-fuzz-base/base-runner", - "bash", - "-c", - "test_all.py || (echo \"********************************************************************************\nBuild checks failed.\nTo reproduce, run:\npython infra/helper.py build_image test-project\npython infra/helper.py build_fuzzers --sanitizer address --engine centipede --architecture x86_64 test-project\npython infra/helper.py check_build --sanitizer address --engine centipede --architecture x86_64 test-project\n********************************************************************************\" && false)" - ], - "id": "build-check-centipede-address-x86_64" - }, - { - "name": "gcr.io/oss-fuzz-base/base-runner", - "env": [ - "ARCHITECTURE=x86_64", - "FUZZING_ENGINE=centipede", - "FUZZING_LANGUAGE=c++", - "HOME=/root", - "OUT=/workspace/out/centipede-address-x86_64", - "SANITIZER=address" - ], - "args": [ - "bash", - "-c", - "targets_list > /workspace/targets.list.address" - ] - }, - { - "name": "gcr.io/oss-fuzz/test-project", - "args": [ - "bash", - "-c", - "cd /workspace/out/centipede-address-x86_64 && zip -r test-project-address-202001010000.zip *" - ] - }, - { - "name": "gcr.io/oss-fuzz-base/uploader", - "args": [ - "/workspace/srcmap.json", - "test_url" - ] - }, - { - "name": "gcr.io/oss-fuzz-base/uploader", - "args": [ - "/workspace/out/centipede-address-x86_64/test-project-address-202001010000.zip", - "test_url" - ] - }, - { - "name": "gcr.io/oss-fuzz-base/uploader", - "args": [ - "/workspace/targets.list.address", - "test_url" - ] - }, - { - "name": "gcr.io/cloud-builders/curl", - "args": [ - "-H", - "Content-Type: text/plain", - "-X", - "PUT", - "-d", - "test-project-address-202001010000.zip", - "test_url" - ] - }, - { - "name": "gcr.io/oss-fuzz/test-project", - "args": [ - "bash", - "-c", - "rm -r /workspace/out/centipede-address-x86_64" - ] - }, - { - "name": "gcr.io/cloud-builders/docker", - "env": [ - "ARCHITECTURE=x86_64", - "FUZZING_ENGINE=centipede", - "FUZZING_LANGUAGE=c++", - "HOME=/root", - "OUT=/workspace/out/centipede-none-x86_64", - "SANITIZER=none" - ], - "args": [ - "run", - "--platform", - "linux/amd64", - "-v", - "/workspace:/workspace", - "--privileged", - "--cap-add=all", - "-e", - "ARCHITECTURE=x86_64", - "-e", - "FUZZING_ENGINE=centipede", - "-e", - "FUZZING_LANGUAGE=c++", - "-e", - "HOME=/root", - "-e", - "OUT=/workspace/out/centipede-none-x86_64", - "-e", - "SANITIZER=none", - "-t", - "gcr.io/oss-fuzz/test-project", - "bash", - "-c", - "rm -r /out && cd /src && cd /src && mkdir -p /workspace/out/centipede-none-x86_64 && compile || (echo \"********************************************************************************\nFailed to build.\nTo reproduce, run:\npython infra/helper.py build_image test-project\npython infra/helper.py build_fuzzers --sanitizer none --engine centipede --architecture x86_64 test-project\n********************************************************************************\" && false)" - ], - "id": "compile-centipede-none-x86_64" - }, - { - "name": "gcr.io/cloud-builders/docker", - "env": [ - "ARCHITECTURE=x86_64", - "FUZZING_ENGINE=centipede", - "FUZZING_LANGUAGE=c++", - "HOME=/root", - "OUT=/workspace/out/centipede-none-x86_64", - "SANITIZER=none" - ], - "args": [ - "run", - "--platform", - "linux/amd64", - "-v", - "/workspace:/workspace", - "--privileged", - "--cap-add=all", - "-e", - "ARCHITECTURE=x86_64", - "-e", - "FUZZING_ENGINE=centipede", - "-e", - "FUZZING_LANGUAGE=c++", - "-e", - "HOME=/root", - "-e", - "OUT=/workspace/out/centipede-none-x86_64", - "-e", - "SANITIZER=none", - "-t", - "gcr.io/oss-fuzz-base/base-runner", - "bash", - "-c", - "test_all.py || (echo \"********************************************************************************\nBuild checks failed.\nTo reproduce, run:\npython infra/helper.py build_image test-project\npython infra/helper.py build_fuzzers --sanitizer none --engine centipede --architecture x86_64 test-project\npython infra/helper.py check_build --sanitizer none --engine centipede --architecture x86_64 test-project\n********************************************************************************\" && false)" - ], - "id": "build-check-centipede-none-x86_64" - }, - { - "name": "gcr.io/oss-fuzz-base/base-runner", - "env": [ - "ARCHITECTURE=x86_64", - "FUZZING_ENGINE=centipede", - "FUZZING_LANGUAGE=c++", - "HOME=/root", - "OUT=/workspace/out/centipede-none-x86_64", - "SANITIZER=none" - ], - "args": [ - "bash", - "-c", - "targets_list > /workspace/targets.list.none" - ] - }, - { - "name": "gcr.io/oss-fuzz/test-project", - "args": [ - "bash", - "-c", - "cd /workspace/out/centipede-none-x86_64 && zip -r test-project-none-202001010000.zip *" - ] - }, - { - "name": "gcr.io/oss-fuzz-base/uploader", - "args": [ - "/workspace/srcmap.json", - "test_url" - ] - }, - { - "name": "gcr.io/oss-fuzz-base/uploader", - "args": [ - "/workspace/out/centipede-none-x86_64/test-project-none-202001010000.zip", - "test_url" - ] - }, - { - "name": "gcr.io/oss-fuzz-base/uploader", - "args": [ - "/workspace/targets.list.none", - "test_url" - ] - }, - { - "name": "gcr.io/cloud-builders/curl", - "args": [ - "-H", - "Content-Type: text/plain", - "-X", - "PUT", - "-d", - "test-project-none-202001010000.zip", - "test_url" - ] - }, - { - "name": "gcr.io/oss-fuzz/test-project", - "args": [ - "bash", - "-c", - "rm -r /workspace/out/centipede-none-x86_64" - ] - }, { "name": "gcr.io/cloud-builders/docker", "env": [ diff --git a/infra/ci/build.py b/infra/ci/build.py index 18a22c95d6d0..8e573ae68f20 100755 --- a/infra/ci/build.py +++ b/infra/ci/build.py @@ -33,7 +33,7 @@ CANARY_PROJECT = 'skcms' DEFAULT_ARCHITECTURES = ['x86_64'] -DEFAULT_ENGINES = ['afl', 'honggfuzz', 'libfuzzer', 'centipede'] +DEFAULT_ENGINES = ['afl', 'honggfuzz', 'libfuzzer'] DEFAULT_SANITIZERS = ['address', 'undefined'] From f50e8d1ec28ec387bd429d2e2c9218549936ee6c Mon Sep 17 00:00:00 2001 From: Jonathan Metzman Date: Wed, 8 Feb 2023 11:24:53 -0500 Subject: [PATCH 15/16] undo --- projects/gdbm/project.yaml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/projects/gdbm/project.yaml b/projects/gdbm/project.yaml index fdf5fe573235..2169eeabfbc2 100644 --- a/projects/gdbm/project.yaml +++ b/projects/gdbm/project.yaml @@ -4,7 +4,3 @@ primary_contact: "sergey.poznyakoff@gmail.com" auto_ccs: - "gray@gnu.org" main_repo: "https://git.gnu.org.ua/gdbm.git" -fuzzing_engines: - - afl - - honggfuzz - - libfuzzer From 07f248d8b69f2154f7539a4aa4a6d2cebcab1156 Mon Sep 17 00:00:00 2001 From: Jonathan Metzman Date: Wed, 8 Feb 2023 11:26:18 -0500 Subject: [PATCH 16/16] fix --- .../expected_centipede_build_steps.json | 316 ++++++++++++++++++ 1 file changed, 316 insertions(+) create mode 100644 infra/build/functions/test_data/expected_centipede_build_steps.json diff --git a/infra/build/functions/test_data/expected_centipede_build_steps.json b/infra/build/functions/test_data/expected_centipede_build_steps.json new file mode 100644 index 000000000000..db92d885ec2d --- /dev/null +++ b/infra/build/functions/test_data/expected_centipede_build_steps.json @@ -0,0 +1,316 @@ +[ + { + "args": [ + "clone", + "https://github.com/google/oss-fuzz.git", + "--depth", + "1" + ], + "name": "gcr.io/cloud-builders/git" + }, + { + "name": "gcr.io/cloud-builders/docker", + "args": [ + "build", + "--tag", + "gcr.io/oss-fuzz/test-project", + "." + ], + "dir": "oss-fuzz/projects/test-project" + }, + { + "name": "gcr.io/oss-fuzz/test-project", + "args": [ + "bash", + "-c", + "srcmap > /workspace/srcmap.json && cat /workspace/srcmap.json" + ], + "env": [ + "OSSFUZZ_REVISION=$REVISION_ID", + "FUZZING_LANGUAGE=c++" + ], + "id": "srcmap" + }, + { + "name": "gcr.io/cloud-builders/docker", + "env": [ + "ARCHITECTURE=x86_64", + "FUZZING_ENGINE=centipede", + "FUZZING_LANGUAGE=c++", + "HOME=/root", + "OUT=/workspace/out/centipede-address-x86_64", + "SANITIZER=address" + ], + "args": [ + "run", + "--platform", + "linux/amd64", + "-v", + "/workspace:/workspace", + "--privileged", + "--cap-add=all", + "-e", + "ARCHITECTURE=x86_64", + "-e", + "FUZZING_ENGINE=centipede", + "-e", + "FUZZING_LANGUAGE=c++", + "-e", + "HOME=/root", + "-e", + "OUT=/workspace/out/centipede-address-x86_64", + "-e", + "SANITIZER=address", + "-t", + "gcr.io/oss-fuzz/test-project", + "bash", + "-c", + "rm -r /out && cd /src && cd /src && mkdir -p /workspace/out/centipede-address-x86_64 && compile || (echo \"********************************************************************************\nFailed to build.\nTo reproduce, run:\npython infra/helper.py build_image test-project\npython infra/helper.py build_fuzzers --sanitizer address --engine centipede --architecture x86_64 test-project\n********************************************************************************\" && false)" + ], + "id": "compile-centipede-address-x86_64" + }, + { + "name": "gcr.io/cloud-builders/docker", + "env": [ + "ARCHITECTURE=x86_64", + "FUZZING_ENGINE=centipede", + "FUZZING_LANGUAGE=c++", + "HOME=/root", + "OUT=/workspace/out/centipede-address-x86_64", + "SANITIZER=address" + ], + "args": [ + "run", + "--platform", + "linux/amd64", + "-v", + "/workspace:/workspace", + "--privileged", + "--cap-add=all", + "-e", + "ARCHITECTURE=x86_64", + "-e", + "FUZZING_ENGINE=centipede", + "-e", + "FUZZING_LANGUAGE=c++", + "-e", + "HOME=/root", + "-e", + "OUT=/workspace/out/centipede-address-x86_64", + "-e", + "SANITIZER=address", + "-t", + "gcr.io/oss-fuzz-base/base-runner", + "bash", + "-c", + "test_all.py || (echo \"********************************************************************************\nBuild checks failed.\nTo reproduce, run:\npython infra/helper.py build_image test-project\npython infra/helper.py build_fuzzers --sanitizer address --engine centipede --architecture x86_64 test-project\npython infra/helper.py check_build --sanitizer address --engine centipede --architecture x86_64 test-project\n********************************************************************************\" && false)" + ], + "id": "build-check-centipede-address-x86_64" + }, + { + "name": "gcr.io/oss-fuzz-base/base-runner", + "env": [ + "ARCHITECTURE=x86_64", + "FUZZING_ENGINE=centipede", + "FUZZING_LANGUAGE=c++", + "HOME=/root", + "OUT=/workspace/out/centipede-address-x86_64", + "SANITIZER=address" + ], + "args": [ + "bash", + "-c", + "targets_list > /workspace/targets.list.address" + ] + }, + { + "name": "gcr.io/oss-fuzz/test-project", + "args": [ + "bash", + "-c", + "cd /workspace/out/centipede-address-x86_64 && zip -r test-project-address-202001010000.zip *" + ] + }, + { + "name": "gcr.io/oss-fuzz-base/uploader", + "args": [ + "/workspace/srcmap.json", + "test_url" + ] + }, + { + "name": "gcr.io/oss-fuzz-base/uploader", + "args": [ + "/workspace/out/centipede-address-x86_64/test-project-address-202001010000.zip", + "test_url" + ] + }, + { + "name": "gcr.io/oss-fuzz-base/uploader", + "args": [ + "/workspace/targets.list.address", + "test_url" + ] + }, + { + "name": "gcr.io/cloud-builders/curl", + "args": [ + "-H", + "Content-Type: text/plain", + "-X", + "PUT", + "-d", + "test-project-address-202001010000.zip", + "test_url" + ] + }, + { + "name": "gcr.io/oss-fuzz/test-project", + "args": [ + "bash", + "-c", + "rm -r /workspace/out/centipede-address-x86_64" + ] + }, + { + "name": "gcr.io/cloud-builders/docker", + "env": [ + "ARCHITECTURE=x86_64", + "FUZZING_ENGINE=centipede", + "FUZZING_LANGUAGE=c++", + "HOME=/root", + "OUT=/workspace/out/centipede-none-x86_64", + "SANITIZER=none" + ], + "args": [ + "run", + "--platform", + "linux/amd64", + "-v", + "/workspace:/workspace", + "--privileged", + "--cap-add=all", + "-e", + "ARCHITECTURE=x86_64", + "-e", + "FUZZING_ENGINE=centipede", + "-e", + "FUZZING_LANGUAGE=c++", + "-e", + "HOME=/root", + "-e", + "OUT=/workspace/out/centipede-none-x86_64", + "-e", + "SANITIZER=none", + "-t", + "gcr.io/oss-fuzz/test-project", + "bash", + "-c", + "rm -r /out && cd /src && cd /src && mkdir -p /workspace/out/centipede-none-x86_64 && compile || (echo \"********************************************************************************\nFailed to build.\nTo reproduce, run:\npython infra/helper.py build_image test-project\npython infra/helper.py build_fuzzers --sanitizer none --engine centipede --architecture x86_64 test-project\n********************************************************************************\" && false)" + ], + "id": "compile-centipede-none-x86_64" + }, + { + "name": "gcr.io/cloud-builders/docker", + "env": [ + "ARCHITECTURE=x86_64", + "FUZZING_ENGINE=centipede", + "FUZZING_LANGUAGE=c++", + "HOME=/root", + "OUT=/workspace/out/centipede-none-x86_64", + "SANITIZER=none" + ], + "args": [ + "run", + "--platform", + "linux/amd64", + "-v", + "/workspace:/workspace", + "--privileged", + "--cap-add=all", + "-e", + "ARCHITECTURE=x86_64", + "-e", + "FUZZING_ENGINE=centipede", + "-e", + "FUZZING_LANGUAGE=c++", + "-e", + "HOME=/root", + "-e", + "OUT=/workspace/out/centipede-none-x86_64", + "-e", + "SANITIZER=none", + "-t", + "gcr.io/oss-fuzz-base/base-runner", + "bash", + "-c", + "test_all.py || (echo \"********************************************************************************\nBuild checks failed.\nTo reproduce, run:\npython infra/helper.py build_image test-project\npython infra/helper.py build_fuzzers --sanitizer none --engine centipede --architecture x86_64 test-project\npython infra/helper.py check_build --sanitizer none --engine centipede --architecture x86_64 test-project\n********************************************************************************\" && false)" + ], + "id": "build-check-centipede-none-x86_64" + }, + { + "name": "gcr.io/oss-fuzz-base/base-runner", + "env": [ + "ARCHITECTURE=x86_64", + "FUZZING_ENGINE=centipede", + "FUZZING_LANGUAGE=c++", + "HOME=/root", + "OUT=/workspace/out/centipede-none-x86_64", + "SANITIZER=none" + ], + "args": [ + "bash", + "-c", + "targets_list > /workspace/targets.list.none" + ] + }, + { + "name": "gcr.io/oss-fuzz/test-project", + "args": [ + "bash", + "-c", + "cd /workspace/out/centipede-none-x86_64 && zip -r test-project-none-202001010000.zip *" + ] + }, + { + "name": "gcr.io/oss-fuzz-base/uploader", + "args": [ + "/workspace/srcmap.json", + "test_url" + ] + }, + { + "name": "gcr.io/oss-fuzz-base/uploader", + "args": [ + "/workspace/out/centipede-none-x86_64/test-project-none-202001010000.zip", + "test_url" + ] + }, + { + "name": "gcr.io/oss-fuzz-base/uploader", + "args": [ + "/workspace/targets.list.none", + "test_url" + ] + }, + { + "name": "gcr.io/cloud-builders/curl", + "args": [ + "-H", + "Content-Type: text/plain", + "-X", + "PUT", + "-d", + "test-project-none-202001010000.zip", + "test_url" + ] + }, + { + "name": "gcr.io/oss-fuzz/test-project", + "args": [ + "bash", + "-c", + "rm -r /workspace/out/centipede-none-x86_64" + ] + } +]