Add files using upload-large-folder tool
Browse files- local-test-tika-delta-03/afc-tika/tika-translate/src/main/resources/META-INF/services/org.apache.tika.language.translate.Translator +22 -0
- local-test-tika-delta-03/afc-tika/tika-translate/src/main/resources/org/apache/tika/language/translate/impl/translator.yandex.properties +25 -0
- local-test-tika-delta-03/fuzz-tooling/infra/base-images/base-builder-go/Dockerfile +33 -0
- local-test-tika-delta-03/fuzz-tooling/infra/base-images/base-builder-swift/Dockerfile +22 -0
- local-test-tika-delta-03/fuzz-tooling/infra/cifuzz/actions/run_fuzzers/action.yml +82 -0
- local-test-tika-delta-03/fuzz-tooling/infra/cifuzz/filestore/git/__init__.py +158 -0
- local-test-tika-delta-03/fuzz-tooling/infra/cifuzz/filestore/gsutil/__init__.py +109 -0
- local-test-tika-delta-03/fuzz-tooling/infra/cifuzz/test_data/example_crash_fuzzer_output.txt +202 -0
- local-test-tika-delta-03/fuzz-tooling/infra/cifuzz/test_data/external-project/Makefile +44 -0
- local-test-tika-delta-03/fuzz-tooling/infra/cifuzz/test_data/external-project/do_stuff_fuzzer.cpp +24 -0
- local-test-tika-delta-03/fuzz-tooling/infra/cifuzz/test_data/external-project/do_stuff_fuzzer.dict +6 -0
- local-test-tika-delta-03/fuzz-tooling/infra/cifuzz/test_data/external-project/my_api.cpp +36 -0
- local-test-tika-delta-03/fuzz-tooling/infra/cifuzz/test_data/external-project/standalone_fuzz_target_runner.cpp +47 -0
- local-test-tika-delta-03/fuzz-tooling/infra/pytest.ini +3 -0
- local-test-tika-delta-03/fuzz-tooling/infra/repo_manager_test.py +201 -0
- local-test-tika-delta-03/fuzz-tooling/infra/test +1 -0
- local-test-tika-delta-03/fuzz-tooling/infra/tools/wycheproof/.gitignore +1 -0
- local-test-tika-delta-03/fuzz-tooling/infra/tools/wycheproof/generate_job.py +50 -0
- local-test-tika-delta-03/fuzz-tooling/infra/tools/wycheproof/run.py +50 -0
- local-test-tika-delta-03/fuzz-tooling/tools/vscode-extension/.editorconfig +8 -0
local-test-tika-delta-03/afc-tika/tika-translate/src/main/resources/META-INF/services/org.apache.tika.language.translate.Translator
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Licensed to the Apache Software Foundation (ASF) under one or more
|
| 2 |
+
# contributor license agreements. See the NOTICE file distributed with
|
| 3 |
+
# this work for additional information regarding copyright ownership.
|
| 4 |
+
# The ASF licenses this file to You under the Apache License, Version 2.0
|
| 5 |
+
# (the "License"); you may not use this file except in compliance with
|
| 6 |
+
# the License. You may obtain a copy of the License at
|
| 7 |
+
#
|
| 8 |
+
# http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
#
|
| 10 |
+
# Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
# See the License for the specific language governing permissions and
|
| 14 |
+
# limitations under the License.
|
| 15 |
+
|
| 16 |
+
org.apache.tika.language.translate.impl.MicrosoftTranslator
|
| 17 |
+
org.apache.tika.language.translate.impl.GoogleTranslator
|
| 18 |
+
org.apache.tika.language.translate.impl.Lingo24Translator
|
| 19 |
+
org.apache.tika.language.translate.impl.CachedTranslator
|
| 20 |
+
org.apache.tika.language.translate.impl.JoshuaNetworkTranslator
|
| 21 |
+
org.apache.tika.language.translate.impl.RTGTranslator
|
| 22 |
+
org.apache.tika.language.translate.impl.MarianTranslator
|
local-test-tika-delta-03/afc-tika/tika-translate/src/main/resources/org/apache/tika/language/translate/impl/translator.yandex.properties
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#
|
| 2 |
+
# Licensed to the Apache Software Foundation (ASF) under one or more
|
| 3 |
+
# contributor license agreements. See the NOTICE file distributed with
|
| 4 |
+
# this work for additional information regarding copyright ownership.
|
| 5 |
+
# The ASF licenses this file to You under the Apache License, Version 2.0
|
| 6 |
+
# (the "License"); you may not use this file except in compliance with
|
| 7 |
+
# the License. You may obtain a copy of the License at
|
| 8 |
+
#
|
| 9 |
+
# http://www.apache.org/licenses/LICENSE-2.0
|
| 10 |
+
#
|
| 11 |
+
# Unless required by applicable law or agreed to in writing, software
|
| 12 |
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
| 13 |
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 14 |
+
# See the License for the specific language governing permissions and
|
| 15 |
+
# limitations under the License.
|
| 16 |
+
#
|
| 17 |
+
# To use the YANDEX translate service, you <em>must</em> set your API-Key
|
| 18 |
+
# as described in Translate API, https://tech.yandex.com/translate/
|
| 19 |
+
# If you do not want translation please set the value to "dummy-key".
|
| 20 |
+
|
| 21 |
+
translator.api-key=dummy-key
|
| 22 |
+
|
| 23 |
+
#The Yandex Translate API can handle text in plain and/or html format, the default format is plain.
|
| 24 |
+
#Set this value to html to enable HTML format support
|
| 25 |
+
translator.text.format=plain
|
local-test-tika-delta-03/fuzz-tooling/infra/base-images/base-builder-go/Dockerfile
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Copyright 2021 Google LLC
|
| 2 |
+
#
|
| 3 |
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
| 4 |
+
# you may not use this file except in compliance with the License.
|
| 5 |
+
# You may obtain a copy of the License at
|
| 6 |
+
#
|
| 7 |
+
# http://www.apache.org/licenses/LICENSE-2.0
|
| 8 |
+
#
|
| 9 |
+
# Unless required by applicable law or agreed to in writing, software
|
| 10 |
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
| 11 |
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 12 |
+
# See the License for the specific language governing permissions and
|
| 13 |
+
# limitations under the License.
|
| 14 |
+
#
|
| 15 |
+
################################################################################
|
| 16 |
+
|
| 17 |
+
ARG IMG_TAG=latest
|
| 18 |
+
FROM ghcr.io/aixcc-finals/base-builder:${IMG_TAG}
|
| 19 |
+
|
| 20 |
+
# Set up Golang environment variables (copied from /root/.bash_profile).
|
| 21 |
+
ENV GOPATH /root/go
|
| 22 |
+
|
| 23 |
+
# /root/.go/bin is for the standard Go binaries (i.e. go, gofmt, etc).
|
| 24 |
+
# $GOPATH/bin is for the binaries from the dependencies installed via "go get".
|
| 25 |
+
ENV PATH $PATH:/root/.go/bin:$GOPATH/bin
|
| 26 |
+
|
| 27 |
+
COPY gosigfuzz.c $GOPATH/gosigfuzz/
|
| 28 |
+
|
| 29 |
+
RUN install_go.sh
|
| 30 |
+
|
| 31 |
+
# TODO(jonathanmetzman): Install this file using install_go.sh.
|
| 32 |
+
COPY ossfuzz_coverage_runner.go \
|
| 33 |
+
$GOPATH/
|
local-test-tika-delta-03/fuzz-tooling/infra/base-images/base-builder-swift/Dockerfile
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Copyright 2021 Google LLC
|
| 2 |
+
#
|
| 3 |
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
| 4 |
+
# you may not use this file except in compliance with the License.
|
| 5 |
+
# You may obtain a copy of the License at
|
| 6 |
+
#
|
| 7 |
+
# http://www.apache.org/licenses/LICENSE-2.0
|
| 8 |
+
#
|
| 9 |
+
# Unless required by applicable law or agreed to in writing, software
|
| 10 |
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
| 11 |
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 12 |
+
# See the License for the specific language governing permissions and
|
| 13 |
+
# limitations under the License.
|
| 14 |
+
#
|
| 15 |
+
################################################################################
|
| 16 |
+
|
| 17 |
+
ARG IMG_TAG=latest
|
| 18 |
+
FROM ghcr.io/aixcc-finals/base-builder:${IMG_TAG}
|
| 19 |
+
|
| 20 |
+
RUN install_swift.sh
|
| 21 |
+
|
| 22 |
+
COPY precompile_swift /usr/local/bin/
|
local-test-tika-delta-03/fuzz-tooling/infra/cifuzz/actions/run_fuzzers/action.yml
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# action.yml
|
| 2 |
+
name: 'run-fuzzers'
|
| 3 |
+
description: 'Runs fuzz target binaries for a specified length of time.'
|
| 4 |
+
inputs:
|
| 5 |
+
oss-fuzz-project-name:
|
| 6 |
+
description: 'The OSS-Fuzz project name.'
|
| 7 |
+
required: true
|
| 8 |
+
language:
|
| 9 |
+
description: 'Programming language project is written in.'
|
| 10 |
+
required: false
|
| 11 |
+
default: 'c++'
|
| 12 |
+
fuzz-seconds:
|
| 13 |
+
description: 'The total time allotted for fuzzing in seconds.'
|
| 14 |
+
required: true
|
| 15 |
+
default: 600
|
| 16 |
+
dry-run:
|
| 17 |
+
description: 'If set, run the action without actually reporting a failure.'
|
| 18 |
+
default: false
|
| 19 |
+
sanitizer:
|
| 20 |
+
description: 'The sanitizer to run the fuzzers with.'
|
| 21 |
+
default: 'address'
|
| 22 |
+
mode:
|
| 23 |
+
description: |
|
| 24 |
+
The mode to run the fuzzers with ("code-change", "batch", "coverage", or "prune").
|
| 25 |
+
"code-change" is for fuzzing a pull request or commit.
|
| 26 |
+
"batch" is for non-interactive fuzzing of an entire project.
|
| 27 |
+
"coverage" is for coverage generation.
|
| 28 |
+
"prune" is for corpus pruning.
|
| 29 |
+
required: false
|
| 30 |
+
default: 'code-change'
|
| 31 |
+
github-token:
|
| 32 |
+
description: |
|
| 33 |
+
Token for GitHub API. WARNING: THIS SHOULD NOT BE USED IN PRODUCTION YET
|
| 34 |
+
You should use "secrets.GITHUB_TOKEN" in your workflow file, do not
|
| 35 |
+
hardcode the token.
|
| 36 |
+
TODO(https://github.com/google/oss-fuzz/pull/5841#discussion_r639393361):
|
| 37 |
+
Document locking this down.
|
| 38 |
+
required: false
|
| 39 |
+
report-unreproducible-crashes:
|
| 40 |
+
description: 'If True, then unreproducible crashes will be reported.'
|
| 41 |
+
required: false
|
| 42 |
+
default: False
|
| 43 |
+
minimize-crashes:
|
| 44 |
+
description: 'If True, reportable crashes will be minimized.'
|
| 45 |
+
required: false
|
| 46 |
+
default: False
|
| 47 |
+
parallel-fuzzing:
|
| 48 |
+
description: "Whether to use all available cores for fuzzing."
|
| 49 |
+
required: false
|
| 50 |
+
default: false
|
| 51 |
+
output-sarif:
|
| 52 |
+
description: "Whether to output fuzzing results to SARIF."
|
| 53 |
+
required: false
|
| 54 |
+
default: false
|
| 55 |
+
report-timeouts:
|
| 56 |
+
description: "Whether to report fails due to timeout."
|
| 57 |
+
required: false
|
| 58 |
+
default: true
|
| 59 |
+
report-ooms:
|
| 60 |
+
description: "Whether to report fails due to OOM."
|
| 61 |
+
required: false
|
| 62 |
+
default: true
|
| 63 |
+
runs:
|
| 64 |
+
using: 'docker'
|
| 65 |
+
image: '../../../run_fuzzers.Dockerfile'
|
| 66 |
+
env:
|
| 67 |
+
OSS_FUZZ_PROJECT_NAME: ${{ inputs.oss-fuzz-project-name }}
|
| 68 |
+
LANGUAGE: ${{ inputs.language }}
|
| 69 |
+
FUZZ_SECONDS: ${{ inputs.fuzz-seconds }}
|
| 70 |
+
DRY_RUN: ${{ inputs.dry-run}}
|
| 71 |
+
SANITIZER: ${{ inputs.sanitizer }}
|
| 72 |
+
MODE: ${{ inputs.mode }}
|
| 73 |
+
GITHUB_TOKEN: ${{ inputs.github-token }}
|
| 74 |
+
LOW_DISK_SPACE: 'True'
|
| 75 |
+
REPORT_UNREPRODUCIBLE_CRASHES: ${{ inputs.report-unreproducible-crashes }}
|
| 76 |
+
MINIMIZE_CRASHES: ${{ inputs.minimize-crashes }}
|
| 77 |
+
CIFUZZ_DEBUG: 'True'
|
| 78 |
+
CFL_PLATFORM: 'github'
|
| 79 |
+
PARALLEL_FUZZING: ${{ inputs.parallel-fuzzing }}
|
| 80 |
+
OUTPUT_SARIF: ${{ inputs.output-sarif }}
|
| 81 |
+
REPORT_TIMEOUTS: ${{ inputs.report-timeouts }}
|
| 82 |
+
REPORT_OOMS: ${{ inputs.report-ooms}}
|
local-test-tika-delta-03/fuzz-tooling/infra/cifuzz/filestore/git/__init__.py
ADDED
|
@@ -0,0 +1,158 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Copyright 2021 Google LLC
|
| 2 |
+
#
|
| 3 |
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
| 4 |
+
# you may not use this file except in compliance with the License.
|
| 5 |
+
# You may obtain a copy of the License at
|
| 6 |
+
#
|
| 7 |
+
# http://www.apache.org/licenses/LICENSE-2.0
|
| 8 |
+
#
|
| 9 |
+
# Unless required by applicable law or agreed to in writing, software
|
| 10 |
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
| 11 |
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 12 |
+
# See the License for the specific language governing permissions and
|
| 13 |
+
# limitations under the License.
|
| 14 |
+
"""Module for a git based filestore."""
|
| 15 |
+
|
| 16 |
+
import logging
|
| 17 |
+
import os
|
| 18 |
+
import shutil
|
| 19 |
+
import subprocess
|
| 20 |
+
import sys
|
| 21 |
+
import tempfile
|
| 22 |
+
|
| 23 |
+
import filestore
|
| 24 |
+
|
| 25 |
+
# pylint: disable=wrong-import-position
|
| 26 |
+
INFRA_DIR = os.path.dirname(
|
| 27 |
+
os.path.dirname(os.path.dirname(os.path.dirname(
|
| 28 |
+
os.path.abspath(__file__)))))
|
| 29 |
+
sys.path.append(INFRA_DIR)
|
| 30 |
+
|
| 31 |
+
import retry
|
| 32 |
+
|
| 33 |
+
_PUSH_RETRIES = 3
|
| 34 |
+
_PUSH_BACKOFF = 1
|
| 35 |
+
_GIT_EMAIL = 'cifuzz@clusterfuzz.com'
|
| 36 |
+
_GIT_NAME = 'CIFuzz'
|
| 37 |
+
_CORPUS_DIR = 'corpus'
|
| 38 |
+
_COVERAGE_DIR = 'coverage'
|
| 39 |
+
|
| 40 |
+
|
| 41 |
+
def git_runner(repo_path):
|
| 42 |
+
"""Returns a gits runner for the repo_path."""
|
| 43 |
+
|
| 44 |
+
def func(*args):
|
| 45 |
+
return subprocess.check_call(('git', '-C', repo_path) + args)
|
| 46 |
+
|
| 47 |
+
return func
|
| 48 |
+
|
| 49 |
+
|
| 50 |
+
# pylint: disable=unused-argument,no-self-use
|
| 51 |
+
class GitFilestore(filestore.BaseFilestore):
|
| 52 |
+
"""Generic git filestore. This still relies on another filestore provided by
|
| 53 |
+
the CI for larger artifacts or artifacts which make sense to be included as
|
| 54 |
+
the result of a workflow run."""
|
| 55 |
+
|
| 56 |
+
def __init__(self, config, ci_filestore):
|
| 57 |
+
super().__init__(config)
|
| 58 |
+
self.repo_path = tempfile.mkdtemp()
|
| 59 |
+
self._git = git_runner(self.repo_path)
|
| 60 |
+
self._clone(self.config.git_store_repo)
|
| 61 |
+
|
| 62 |
+
self._ci_filestore = ci_filestore
|
| 63 |
+
|
| 64 |
+
def __del__(self):
|
| 65 |
+
shutil.rmtree(self.repo_path)
|
| 66 |
+
|
| 67 |
+
def _clone(self, repo_url):
|
| 68 |
+
"""Clones repo URL."""
|
| 69 |
+
self._git('clone', repo_url, '.')
|
| 70 |
+
self._git('config', '--local', 'user.email', _GIT_EMAIL)
|
| 71 |
+
self._git('config', '--local', 'user.name', _GIT_NAME)
|
| 72 |
+
|
| 73 |
+
def _reset_git(self, branch):
|
| 74 |
+
"""Resets the git repo."""
|
| 75 |
+
self._git('fetch', 'origin')
|
| 76 |
+
try:
|
| 77 |
+
self._git('checkout', '-B', branch, 'origin/' + branch)
|
| 78 |
+
self._git('reset', '--hard', 'HEAD')
|
| 79 |
+
except subprocess.CalledProcessError:
|
| 80 |
+
self._git('checkout', '--orphan', branch)
|
| 81 |
+
|
| 82 |
+
self._git('clean', '-fxd')
|
| 83 |
+
|
| 84 |
+
# pylint: disable=too-many-arguments
|
| 85 |
+
@retry.wrap(_PUSH_RETRIES, _PUSH_BACKOFF)
|
| 86 |
+
def _upload_to_git(self,
|
| 87 |
+
message,
|
| 88 |
+
branch,
|
| 89 |
+
upload_path,
|
| 90 |
+
local_path,
|
| 91 |
+
replace=False):
|
| 92 |
+
"""Uploads a directory to git. If `replace` is True, then existing contents
|
| 93 |
+
in the upload_path is deleted."""
|
| 94 |
+
self._reset_git(branch)
|
| 95 |
+
|
| 96 |
+
full_repo_path = os.path.join(self.repo_path, upload_path)
|
| 97 |
+
if replace and os.path.exists(full_repo_path):
|
| 98 |
+
shutil.rmtree(full_repo_path)
|
| 99 |
+
|
| 100 |
+
shutil.copytree(local_path, full_repo_path, dirs_exist_ok=True)
|
| 101 |
+
self._git('add', '.')
|
| 102 |
+
try:
|
| 103 |
+
self._git('commit', '-m', message)
|
| 104 |
+
except subprocess.CalledProcessError:
|
| 105 |
+
logging.debug('No changes, skipping git push.')
|
| 106 |
+
return
|
| 107 |
+
|
| 108 |
+
self._git('push', 'origin', branch)
|
| 109 |
+
|
| 110 |
+
def upload_crashes(self, name, directory):
|
| 111 |
+
"""Uploads the crashes at |directory| to |name|."""
|
| 112 |
+
return self._ci_filestore.upload_crashes(name, directory)
|
| 113 |
+
|
| 114 |
+
def upload_corpus(self, name, directory, replace=False):
|
| 115 |
+
"""Uploads the corpus at |directory| to |name|."""
|
| 116 |
+
self._upload_to_git('Corpus upload',
|
| 117 |
+
self.config.git_store_branch,
|
| 118 |
+
os.path.join(_CORPUS_DIR, name),
|
| 119 |
+
directory,
|
| 120 |
+
replace=replace)
|
| 121 |
+
|
| 122 |
+
def upload_build(self, name, directory):
|
| 123 |
+
"""Uploads the build at |directory| to |name|."""
|
| 124 |
+
return self._ci_filestore.upload_build(name, directory)
|
| 125 |
+
|
| 126 |
+
def upload_coverage(self, name, directory):
|
| 127 |
+
"""Uploads the coverage report at |directory| to |name|."""
|
| 128 |
+
self._upload_to_git('Coverage upload',
|
| 129 |
+
self.config.git_store_branch_coverage,
|
| 130 |
+
os.path.join(_COVERAGE_DIR, name),
|
| 131 |
+
directory,
|
| 132 |
+
replace=True)
|
| 133 |
+
|
| 134 |
+
def download_corpus(self, name, dst_directory):
|
| 135 |
+
"""Downloads the corpus located at |name| to |dst_directory|."""
|
| 136 |
+
self._reset_git(self.config.git_store_branch)
|
| 137 |
+
path = os.path.join(self.repo_path, _CORPUS_DIR, name)
|
| 138 |
+
if not os.path.exists(path):
|
| 139 |
+
logging.debug('Corpus does not exist at %s.', path)
|
| 140 |
+
return False
|
| 141 |
+
|
| 142 |
+
shutil.copytree(path, dst_directory, dirs_exist_ok=True)
|
| 143 |
+
return True
|
| 144 |
+
|
| 145 |
+
def download_build(self, name, dst_directory):
|
| 146 |
+
"""Downloads the build with |name| to |dst_directory|."""
|
| 147 |
+
return self._ci_filestore.download_build(name, dst_directory)
|
| 148 |
+
|
| 149 |
+
def download_coverage(self, name, dst_directory):
|
| 150 |
+
"""Downloads the latest project coverage report."""
|
| 151 |
+
self._reset_git(self.config.git_store_branch_coverage)
|
| 152 |
+
path = os.path.join(self.repo_path, _COVERAGE_DIR, name)
|
| 153 |
+
if not os.path.exists(path):
|
| 154 |
+
logging.debug('Coverage does not exist at %s.', path)
|
| 155 |
+
return False
|
| 156 |
+
|
| 157 |
+
shutil.copytree(path, dst_directory, dirs_exist_ok=True)
|
| 158 |
+
return True
|
local-test-tika-delta-03/fuzz-tooling/infra/cifuzz/filestore/gsutil/__init__.py
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Copyright 2021 Google LLC
|
| 2 |
+
#
|
| 3 |
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
| 4 |
+
# you may not use this file except in compliance with the License.
|
| 5 |
+
# You may obtain a copy of the License at
|
| 6 |
+
#
|
| 7 |
+
# http://www.apache.org/licenses/LICENSE-2.0
|
| 8 |
+
#
|
| 9 |
+
# Unless required by applicable law or agreed to in writing, software
|
| 10 |
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
| 11 |
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 12 |
+
# See the License for the specific language governing permissions and
|
| 13 |
+
# limitations under the License.
|
| 14 |
+
"""Filestore implementation using gsutil."""
|
| 15 |
+
import logging
|
| 16 |
+
import os
|
| 17 |
+
import posixpath
|
| 18 |
+
import subprocess
|
| 19 |
+
import sys
|
| 20 |
+
|
| 21 |
+
# pylint: disable=wrong-import-position,import-error
|
| 22 |
+
sys.path.append(
|
| 23 |
+
os.path.join(os.path.dirname(os.path.abspath(__file__)), os.pardir,
|
| 24 |
+
os.pardir, os.pardir))
|
| 25 |
+
import filestore
|
| 26 |
+
import utils
|
| 27 |
+
|
| 28 |
+
|
| 29 |
+
def _gsutil_execute(*args, parallel=True):
|
| 30 |
+
"""Executes a gsutil command, passing |*args| to gsutil and returns the
|
| 31 |
+
stdout, stderr and returncode. Exceptions on failure."""
|
| 32 |
+
command = ['gsutil']
|
| 33 |
+
if parallel:
|
| 34 |
+
command.append('-m')
|
| 35 |
+
command += list(args)
|
| 36 |
+
logging.info('Executing gsutil command: %s', command)
|
| 37 |
+
return utils.execute(command, check_result=True)
|
| 38 |
+
|
| 39 |
+
|
| 40 |
+
def _rsync(src, dst, recursive=True, delete=False):
|
| 41 |
+
"""Executes gsutil rsync on |src| and |dst|"""
|
| 42 |
+
args = ['rsync']
|
| 43 |
+
if recursive:
|
| 44 |
+
args.append('-r')
|
| 45 |
+
if delete:
|
| 46 |
+
args.append('-d')
|
| 47 |
+
args += [src, dst]
|
| 48 |
+
return _gsutil_execute(*args)
|
| 49 |
+
|
| 50 |
+
|
| 51 |
+
class GSUtilFilestore(filestore.BaseFilestore):
|
| 52 |
+
"""Filestore implementation using gsutil."""
|
| 53 |
+
BUILD_DIR = 'build'
|
| 54 |
+
CRASHES_DIR = 'crashes'
|
| 55 |
+
CORPUS_DIR = 'corpus'
|
| 56 |
+
COVERAGE_DIR = 'coverage'
|
| 57 |
+
|
| 58 |
+
def __init__(self, config):
|
| 59 |
+
super().__init__(config)
|
| 60 |
+
self._cloud_bucket = self.config.cloud_bucket
|
| 61 |
+
|
| 62 |
+
def _get_gsutil_url(self, name, prefix_dir):
|
| 63 |
+
"""Returns the gsutil URL for |name| and |prefix_dir|."""
|
| 64 |
+
if not prefix_dir:
|
| 65 |
+
return posixpath.join(self._cloud_bucket, name)
|
| 66 |
+
return posixpath.join(self._cloud_bucket, prefix_dir, name)
|
| 67 |
+
|
| 68 |
+
def _upload_directory(self, name, directory, prefix, delete=False):
|
| 69 |
+
gsutil_url = self._get_gsutil_url(name, prefix)
|
| 70 |
+
return _rsync(directory, gsutil_url, delete=delete)
|
| 71 |
+
|
| 72 |
+
def _download_directory(self, name, dst_directory, prefix):
|
| 73 |
+
gsutil_url = self._get_gsutil_url(name, prefix)
|
| 74 |
+
return _rsync(gsutil_url, dst_directory)
|
| 75 |
+
|
| 76 |
+
def upload_crashes(self, name, directory):
|
| 77 |
+
"""Uploads the crashes at |directory| to |name|."""
|
| 78 |
+
# Name is going to be "current". I don't know if this makes sense outside of
|
| 79 |
+
# GitHub Actions.
|
| 80 |
+
gsutil_url = self._get_gsutil_url(name, self.CRASHES_DIR)
|
| 81 |
+
logging.info('Uploading crashes to %s.', gsutil_url)
|
| 82 |
+
return _rsync(directory, gsutil_url)
|
| 83 |
+
|
| 84 |
+
def upload_corpus(self, name, directory, replace=False):
|
| 85 |
+
"""Uploads the crashes at |directory| to |name|."""
|
| 86 |
+
return self._upload_directory(name,
|
| 87 |
+
directory,
|
| 88 |
+
self.CORPUS_DIR,
|
| 89 |
+
delete=replace)
|
| 90 |
+
|
| 91 |
+
def upload_build(self, name, directory):
|
| 92 |
+
"""Uploads the build located at |directory| to |name|."""
|
| 93 |
+
return self._upload_directory(name, directory, self.BUILD_DIR)
|
| 94 |
+
|
| 95 |
+
def upload_coverage(self, name, directory):
|
| 96 |
+
"""Uploads the coverage report at |directory| to |name|."""
|
| 97 |
+
return self._upload_directory(name, directory, self.COVERAGE_DIR)
|
| 98 |
+
|
| 99 |
+
def download_corpus(self, name, dst_directory):
|
| 100 |
+
"""Downloads the corpus located at |name| to |dst_directory|."""
|
| 101 |
+
return self._download_directory(name, dst_directory, self.CORPUS_DIR)
|
| 102 |
+
|
| 103 |
+
def download_build(self, name, dst_directory):
|
| 104 |
+
"""Downloads the build with |name| to |dst_directory|."""
|
| 105 |
+
return self._download_directory(name, dst_directory, self.BUILD_DIR)
|
| 106 |
+
|
| 107 |
+
def download_coverage(self, name, dst_directory):
|
| 108 |
+
"""Downloads the latest project coverage report."""
|
| 109 |
+
return self._download_directory(name, dst_directory, self.COVERAGE_DIR)
|
local-test-tika-delta-03/fuzz-tooling/infra/cifuzz/test_data/example_crash_fuzzer_output.txt
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/github/workspace/build-out/do_stuff_fuzzer -timeout=25 -rss_limit_mb=2560 -dict=/github/workspace/build-out/do_stuff_fuzzer.dict -len_control=0 -seed=1337 -artifact_prefix=/tmp/tmp9p1w4p8r/ -max_total_time=600 -print_final_stats=1 /github/workspace/cifuzz-corpus/do_stuff_fuzzer >fuzz-0.log 2>&1
|
| 2 |
+
================== Job 0 exited with exit code 77 ============
|
| 3 |
+
Dictionary: 3 entries
|
| 4 |
+
INFO: Running with entropic power schedule (0xFF, 100).
|
| 5 |
+
INFO: Seed: 1337
|
| 6 |
+
INFO: Loaded 1 modules (86 inline 8-bit counters): 86 [0x6150e0, 0x615136),
|
| 7 |
+
INFO: Loaded 1 PC tables (86 PCs): 86 [0x5c8b08,0x5c9068),
|
| 8 |
+
INFO: 5 files found in /github/workspace/cifuzz-corpus/do_stuff_fuzzer
|
| 9 |
+
INFO: -max_len is not provided; libFuzzer will not generate inputs larger than 4096 bytes
|
| 10 |
+
INFO: seed corpus: files: 5 min: 3b max: 44b total: 64b rss: 31Mb
|
| 11 |
+
#6 INITED cov: 64 ft: 70 corp: 5/64b exec/s: 0 rss: 32Mb
|
| 12 |
+
#9 NEW cov: 64 ft: 72 corp: 6/74b lim: 4096 exec/s: 0 rss: 32Mb L: 10/44 MS: 3 ChangeBit-InsertByte-ManualDict- DE: "foo"-
|
| 13 |
+
#17 NEW cov: 64 ft: 74 corp: 7/86b lim: 4096 exec/s: 0 rss: 32Mb L: 12/44 MS: 3 ChangeBit-ManualDict-PersAutoDict- DE: "ouch"-"foo"-
|
| 14 |
+
#18 NEW cov: 64 ft: 76 corp: 8/100b lim: 4096 exec/s: 0 rss: 32Mb L: 14/44 MS: 1 CrossOver-
|
| 15 |
+
#22 NEW cov: 64 ft: 78 corp: 9/141b lim: 4096 exec/s: 0 rss: 32Mb L: 41/44 MS: 4 InsertRepeatedBytes-CopyPart-ChangeBinInt-ChangeBit-
|
| 16 |
+
#24 NEW cov: 64 ft: 80 corp: 10/151b lim: 4096 exec/s: 0 rss: 32Mb L: 10/44 MS: 2 CrossOver-CopyPart-
|
| 17 |
+
#28 NEW cov: 64 ft: 81 corp: 11/171b lim: 4096 exec/s: 0 rss: 32Mb L: 20/44 MS: 4 InsertByte-PersAutoDict-ShuffleBytes-ManualDict- DE: "foo"-"ouch"-
|
| 18 |
+
#43 NEW cov: 65 ft: 83 corp: 12/175b lim: 4096 exec/s: 0 rss: 32Mb L: 4/44 MS: 5 InsertByte-ChangeBit-ManualDict-ManualDict-EraseBytes- DE: "bar"-"bar"-
|
| 19 |
+
#54 NEW cov: 65 ft: 84 corp: 13/191b lim: 4096 exec/s: 0 rss: 32Mb L: 16/44 MS: 1 CrossOver-
|
| 20 |
+
#64 NEW cov: 65 ft: 86 corp: 14/209b lim: 4096 exec/s: 0 rss: 32Mb L: 18/44 MS: 5 InsertByte-ChangeBinInt-CMP-PersAutoDict-CopyPart- DE: "\000\000"-"foo"-
|
| 21 |
+
#75 REDUCE cov: 65 ft: 86 corp: 14/203b lim: 4096 exec/s: 0 rss: 32Mb L: 35/44 MS: 1 EraseBytes-
|
| 22 |
+
#76 REDUCE cov: 65 ft: 86 corp: 14/195b lim: 4096 exec/s: 0 rss: 32Mb L: 36/36 MS: 1 EraseBytes-
|
| 23 |
+
=================================================================
|
| 24 |
+
==26==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x603000003114 at pc 0x00000056d1db bp 0x7fffd6a72bf0 sp 0x7fffd6a72be8
|
| 25 |
+
READ of size 4 at 0x603000003114 thread T0
|
| 26 |
+
SCARINESS: 17 (4-byte-read-heap-buffer-overflow)
|
| 27 |
+
#0 0x56d1da in DoStuff(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) /src/cifuzz-example/my_api.cpp:26:10
|
| 28 |
+
#1 0x56c5d6 in LLVMFuzzerTestOneInput /src/cifuzz-example/do_stuff_fuzzer.cpp:15:3
|
| 29 |
+
#2 0x43de23 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:611:15
|
| 30 |
+
#3 0x43d60a in fuzzer::Fuzzer::RunOne(unsigned char const*, unsigned long, bool, fuzzer::InputInfo*, bool, bool*) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:514:3
|
| 31 |
+
#4 0x43ecd9 in fuzzer::Fuzzer::MutateAndTestOne() /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:757:19
|
| 32 |
+
#5 0x43f9a5 in fuzzer::Fuzzer::Loop(std::__Fuzzer::vector<fuzzer::SizedFile, std::__Fuzzer::allocator<fuzzer::SizedFile> >&) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:895:5
|
| 33 |
+
#6 0x42ed0f in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:912:6
|
| 34 |
+
#7 0x458362 in main /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerMain.cpp:20:10
|
| 35 |
+
#8 0x7fcfaa2aa082 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24082) (BuildId: 1878e6b475720c7c51969e69ab2d276fae6d1dee)
|
| 36 |
+
#9 0x41f74d in _start (build-out/do_stuff_fuzzer+0x41f74d)
|
| 37 |
+
|
| 38 |
+
DEDUP_TOKEN: DoStuff(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)--LLVMFuzzerTestOneInput--fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long)
|
| 39 |
+
0x603000003114 is located 0 bytes to the right of 20-byte region [0x603000003100,0x603000003114)
|
| 40 |
+
allocated by thread T0 here:
|
| 41 |
+
#0 0x569dfd in operator new(unsigned long) /src/llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:95:3
|
| 42 |
+
#1 0x56c9d4 in __libcpp_operator_new<unsigned long> /usr/local/bin/../include/c++/v1/new:245:10
|
| 43 |
+
#2 0x56c9d4 in __libcpp_allocate /usr/local/bin/../include/c++/v1/new:271:10
|
| 44 |
+
#3 0x56c9d4 in allocate /usr/local/bin/../include/c++/v1/__memory/allocator.h:105:38
|
| 45 |
+
#4 0x56c9d4 in allocate /usr/local/bin/../include/c++/v1/__memory/allocator_traits.h:262:20
|
| 46 |
+
#5 0x56c9d4 in __vallocate /usr/local/bin/../include/c++/v1/vector:931:37
|
| 47 |
+
#6 0x56c9d4 in vector /usr/local/bin/../include/c++/v1/vector:1236:9
|
| 48 |
+
#7 0x56c9d4 in DoStuff(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) /src/cifuzz-example/my_api.cpp:14:20
|
| 49 |
+
#8 0x56c5d6 in LLVMFuzzerTestOneInput /src/cifuzz-example/do_stuff_fuzzer.cpp:15:3
|
| 50 |
+
#9 0x43de23 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:611:15
|
| 51 |
+
#10 0x43d60a in fuzzer::Fuzzer::RunOne(unsigned char const*, unsigned long, bool, fuzzer::InputInfo*, bool, bool*) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:514:3
|
| 52 |
+
#11 0x43ecd9 in fuzzer::Fuzzer::MutateAndTestOne() /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:757:19
|
| 53 |
+
#12 0x43f9a5 in fuzzer::Fuzzer::Loop(std::__Fuzzer::vector<fuzzer::SizedFile, std::__Fuzzer::allocator<fuzzer::SizedFile> >&) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:895:5
|
| 54 |
+
#13 0x42ed0f in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:912:6
|
| 55 |
+
#14 0x458362 in main /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerMain.cpp:20:10
|
| 56 |
+
#15 0x7fcfaa2aa082 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24082) (BuildId: 1878e6b475720c7c51969e69ab2d276fae6d1dee)
|
| 57 |
+
|
| 58 |
+
DEDUP_TOKEN: operator new(unsigned long)--__libcpp_operator_new<unsigned long>--__libcpp_allocate
|
| 59 |
+
SUMMARY: AddressSanitizer: heap-buffer-overflow /src/cifuzz-example/my_api.cpp:26:10 in DoStuff(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)
|
| 60 |
+
Shadow bytes around the buggy address:
|
| 61 |
+
0x0c067fff85d0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
|
| 62 |
+
0x0c067fff85e0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
|
| 63 |
+
0x0c067fff85f0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
|
| 64 |
+
0x0c067fff8600: fa fa fd fd fd fa fa fa fd fd fd fa fa fa fd fd
|
| 65 |
+
0x0c067fff8610: fd fa fa fa fd fd fd fa fa fa 00 00 00 00 fa fa
|
| 66 |
+
=>0x0c067fff8620: 00 00[04]fa fa fa fa fa fa fa fa fa fa fa fa fa
|
| 67 |
+
0x0c067fff8630: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
|
| 68 |
+
0x0c067fff8640: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
|
| 69 |
+
0x0c067fff8650: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
|
| 70 |
+
0x0c067fff8660: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
|
| 71 |
+
0x0c067fff8670: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
|
| 72 |
+
Shadow byte legend (one shadow byte represents 8 application bytes):
|
| 73 |
+
Addressable: 00
|
| 74 |
+
Partially addressable: 01 02 03 04 05 06 07
|
| 75 |
+
Heap left redzone: fa
|
| 76 |
+
Freed heap region: fd
|
| 77 |
+
Stack left redzone: f1
|
| 78 |
+
Stack mid redzone: f2
|
| 79 |
+
Stack right redzone: f3
|
| 80 |
+
Stack after return: f5
|
| 81 |
+
Stack use after scope: f8
|
| 82 |
+
Global redzone: f9
|
| 83 |
+
Global init order: f6
|
| 84 |
+
Poisoned by user: f7
|
| 85 |
+
Container overflow: fc
|
| 86 |
+
Array cookie: ac
|
| 87 |
+
Intra object redzone: bb
|
| 88 |
+
ASan internal: fe
|
| 89 |
+
Left alloca redzone: ca
|
| 90 |
+
Right alloca redzone: cb
|
| 91 |
+
==26==ABORTING
|
| 92 |
+
MS: 4 PersAutoDict-ManualDict-CrossOver-PersAutoDict- DE: "foo"-"ouch"-"bar"-; base unit: 1a25c32303e03f997166aee1c665b5ae9f66ec7d
|
| 93 |
+
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x66,0x6f,0x6f,0xff,0x1,0x62,0x61,0x72,0x63,0x68,0x6f,0x75,0x63,0x68,0x66,0x6f,0x66,0x6e,0x6f,0x6d,0x67,0x6d,
|
| 94 |
+
\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377foo\377\001barchouchfofnomgm
|
| 95 |
+
artifact_prefix='/tmp/tmp9p1w4p8r/'; Test unit written to /tmp/tmp9p1w4p8r/crash-1c750df432fe458b738987ba69cd20a598708775
|
| 96 |
+
Base64: //////////////////////9mb2//AWJhcmNob3VjaGZvZm5vbWdt
|
| 97 |
+
stat::number_of_executed_units: 90
|
| 98 |
+
stat::average_exec_per_sec: 0
|
| 99 |
+
stat::new_units_added: 11
|
| 100 |
+
stat::slowest_unit_time_sec: 0
|
| 101 |
+
stat::peak_rss_mb: 33
|
| 102 |
+
/github/workspace/build-out/do_stuff_fuzzer -timeout=25 -rss_limit_mb=2560 -dict=/github/workspace/build-out/do_stuff_fuzzer.dict -len_control=0 -seed=1337 -artifact_prefix=/tmp/tmp9p1w4p8r/ -max_total_time=600 -print_final_stats=1 /github/workspace/cifuzz-corpus/do_stuff_fuzzer >fuzz-1.log 2>&1
|
| 103 |
+
================== Job 1 exited with exit code 77 ============
|
| 104 |
+
Dictionary: 3 entries
|
| 105 |
+
INFO: Running with entropic power schedule (0xFF, 100).
|
| 106 |
+
INFO: Seed: 1337
|
| 107 |
+
INFO: Loaded 1 modules (86 inline 8-bit counters): 86 [0x6150e0, 0x615136),
|
| 108 |
+
INFO: Loaded 1 PC tables (86 PCs): 86 [0x5c8b08,0x5c9068),
|
| 109 |
+
INFO: 15 files found in /github/workspace/cifuzz-corpus/do_stuff_fuzzer
|
| 110 |
+
INFO: -max_len is not provided; libFuzzer will not generate inputs larger than 4096 bytes
|
| 111 |
+
INFO: seed corpus: files: 15 min: 3b max: 44b total: 239b rss: 31Mb
|
| 112 |
+
#16 INITED cov: 65 ft: 86 corp: 13/159b exec/s: 0 rss: 32Mb
|
| 113 |
+
#38 NEW cov: 65 ft: 88 corp: 14/188b lim: 4096 exec/s: 0 rss: 32Mb L: 29/35 MS: 2 InsertByte-CopyPart-
|
| 114 |
+
#43 REDUCE cov: 65 ft: 88 corp: 14/187b lim: 4096 exec/s: 0 rss: 32Mb L: 2/35 MS: 5 InsertByte-ChangeByte-ChangeBinInt-EraseBytes-EraseBytes-
|
| 115 |
+
#64 NEW cov: 66 ft: 89 corp: 15/191b lim: 4096 exec/s: 0 rss: 32Mb L: 4/35 MS: 1 ChangeByte-
|
| 116 |
+
#78 REDUCE cov: 66 ft: 89 corp: 15/190b lim: 4096 exec/s: 0 rss: 32Mb L: 15/35 MS: 4 ChangeBinInt-CopyPart-EraseBytes-EraseBytes-
|
| 117 |
+
#95 REDUCE cov: 66 ft: 89 corp: 15/188b lim: 4096 exec/s: 0 rss: 32Mb L: 16/35 MS: 2 ChangeBinInt-EraseBytes-
|
| 118 |
+
#110 REDUCE cov: 66 ft: 89 corp: 15/184b lim: 4096 exec/s: 0 rss: 32Mb L: 31/31 MS: 5 CrossOver-ChangeByte-ShuffleBytes-InsertByte-EraseBytes-
|
| 119 |
+
#146 REDUCE cov: 66 ft: 89 corp: 15/183b lim: 4096 exec/s: 0 rss: 32Mb L: 1/31 MS: 1 EraseBytes-
|
| 120 |
+
#157 NEW cov: 66 ft: 90 corp: 16/210b lim: 4096 exec/s: 0 rss: 32Mb L: 27/31 MS: 1 CrossOver-
|
| 121 |
+
#230 REDUCE cov: 66 ft: 92 corp: 17/318b lim: 4096 exec/s: 0 rss: 32Mb L: 108/108 MS: 3 CopyPart-InsertRepeatedBytes-CrossOver-
|
| 122 |
+
#277 NEW cov: 66 ft: 94 corp: 18/429b lim: 4096 exec/s: 0 rss: 32Mb L: 111/111 MS: 2 ManualDict-CMP- DE: "bar"-"\000\000\000\000"-
|
| 123 |
+
#337 NEW cov: 67 ft: 95 corp: 19/439b lim: 4096 exec/s: 0 rss: 32Mb L: 10/111 MS: 5 ChangeByte-ChangeBit-ManualDict-CopyPart-EraseBytes- DE: "bar"-
|
| 124 |
+
=================================================================
|
| 125 |
+
==30==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x603000007d94 at pc 0x00000056d1db bp 0x7ffdb9da4b50 sp 0x7ffdb9da4b48
|
| 126 |
+
READ of size 4 at 0x603000007d94 thread T0
|
| 127 |
+
SCARINESS: 17 (4-byte-read-heap-buffer-overflow)
|
| 128 |
+
#0 0x56d1da in DoStuff(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) /src/cifuzz-example/my_api.cpp:26:10
|
| 129 |
+
#1 0x56c5d6 in LLVMFuzzerTestOneInput /src/cifuzz-example/do_stuff_fuzzer.cpp:15:3
|
| 130 |
+
#2 0x43de23 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:611:15
|
| 131 |
+
#3 0x43d60a in fuzzer::Fuzzer::RunOne(unsigned char const*, unsigned long, bool, fuzzer::InputInfo*, bool, bool*) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:514:3
|
| 132 |
+
#4 0x43ecd9 in fuzzer::Fuzzer::MutateAndTestOne() /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:757:19
|
| 133 |
+
#5 0x43f9a5 in fuzzer::Fuzzer::Loop(std::__Fuzzer::vector<fuzzer::SizedFile, std::__Fuzzer::allocator<fuzzer::SizedFile> >&) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:895:5
|
| 134 |
+
#6 0x42ed0f in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:912:6
|
| 135 |
+
#7 0x458362 in main /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerMain.cpp:20:10
|
| 136 |
+
#8 0x7fc2c6bd3082 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24082) (BuildId: 1878e6b475720c7c51969e69ab2d276fae6d1dee)
|
| 137 |
+
#9 0x41f74d in _start (build-out/do_stuff_fuzzer+0x41f74d)
|
| 138 |
+
|
| 139 |
+
DEDUP_TOKEN: DoStuff(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)--LLVMFuzzerTestOneInput--fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long)
|
| 140 |
+
0x603000007d94 is located 0 bytes to the right of 20-byte region [0x603000007d80,0x603000007d94)
|
| 141 |
+
allocated by thread T0 here:
|
| 142 |
+
#0 0x569dfd in operator new(unsigned long) /src/llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:95:3
|
| 143 |
+
#1 0x56c9d4 in __libcpp_operator_new<unsigned long> /usr/local/bin/../include/c++/v1/new:245:10
|
| 144 |
+
#2 0x56c9d4 in __libcpp_allocate /usr/local/bin/../include/c++/v1/new:271:10
|
| 145 |
+
#3 0x56c9d4 in allocate /usr/local/bin/../include/c++/v1/__memory/allocator.h:105:38
|
| 146 |
+
#4 0x56c9d4 in allocate /usr/local/bin/../include/c++/v1/__memory/allocator_traits.h:262:20
|
| 147 |
+
#5 0x56c9d4 in __vallocate /usr/local/bin/../include/c++/v1/vector:931:37
|
| 148 |
+
#6 0x56c9d4 in vector /usr/local/bin/../include/c++/v1/vector:1236:9
|
| 149 |
+
#7 0x56c9d4 in DoStuff(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) /src/cifuzz-example/my_api.cpp:14:20
|
| 150 |
+
#8 0x56c5d6 in LLVMFuzzerTestOneInput /src/cifuzz-example/do_stuff_fuzzer.cpp:15:3
|
| 151 |
+
#9 0x43de23 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:611:15
|
| 152 |
+
#10 0x43d60a in fuzzer::Fuzzer::RunOne(unsigned char const*, unsigned long, bool, fuzzer::InputInfo*, bool, bool*) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:514:3
|
| 153 |
+
#11 0x43ecd9 in fuzzer::Fuzzer::MutateAndTestOne() /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:757:19
|
| 154 |
+
#12 0x43f9a5 in fuzzer::Fuzzer::Loop(std::__Fuzzer::vector<fuzzer::SizedFile, std::__Fuzzer::allocator<fuzzer::SizedFile> >&) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:895:5
|
| 155 |
+
#13 0x42ed0f in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:912:6
|
| 156 |
+
#14 0x458362 in main /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerMain.cpp:20:10
|
| 157 |
+
#15 0x7fc2c6bd3082 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24082) (BuildId: 1878e6b475720c7c51969e69ab2d276fae6d1dee)
|
| 158 |
+
|
| 159 |
+
DEDUP_TOKEN: operator new(unsigned long)--__libcpp_operator_new<unsigned long>--__libcpp_allocate
|
| 160 |
+
SUMMARY: AddressSanitizer: heap-buffer-overflow /src/cifuzz-example/my_api.cpp:26:10 in DoStuff(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)
|
| 161 |
+
Shadow bytes around the buggy address:
|
| 162 |
+
0x0c067fff8f60: fa fa fd fd fd fa fa fa fd fd fd fa fa fa fd fd
|
| 163 |
+
0x0c067fff8f70: fd fa fa fa fd fd fd fa fa fa fd fd fd fa fa fa
|
| 164 |
+
0x0c067fff8f80: fd fd fd fa fa fa fd fd fd fa fa fa fd fd fd fa
|
| 165 |
+
0x0c067fff8f90: fa fa fd fd fd fa fa fa fd fd fd fa fa fa fd fd
|
| 166 |
+
0x0c067fff8fa0: fd fa fa fa fd fd fd fa fa fa fd fd fd fa fa fa
|
| 167 |
+
=>0x0c067fff8fb0: 00 00[04]fa fa fa fa fa fa fa fa fa fa fa fa fa
|
| 168 |
+
0x0c067fff8fc0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
|
| 169 |
+
0x0c067fff8fd0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
|
| 170 |
+
0x0c067fff8fe0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
|
| 171 |
+
0x0c067fff8ff0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
|
| 172 |
+
0x0c067fff9000: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
|
| 173 |
+
Shadow byte legend (one shadow byte represents 8 application bytes):
|
| 174 |
+
Addressable: 00
|
| 175 |
+
Partially addressable: 01 02 03 04 05 06 07
|
| 176 |
+
Heap left redzone: fa
|
| 177 |
+
Freed heap region: fd
|
| 178 |
+
Stack left redzone: f1
|
| 179 |
+
Stack mid redzone: f2
|
| 180 |
+
Stack right redzone: f3
|
| 181 |
+
Stack after return: f5
|
| 182 |
+
Stack use after scope: f8
|
| 183 |
+
Global redzone: f9
|
| 184 |
+
Global init order: f6
|
| 185 |
+
Poisoned by user: f7
|
| 186 |
+
Container overflow: fc
|
| 187 |
+
Array cookie: ac
|
| 188 |
+
Intra object redzone: bb
|
| 189 |
+
ASan internal: fe
|
| 190 |
+
Left alloca redzone: ca
|
| 191 |
+
Right alloca redzone: cb
|
| 192 |
+
==30==ABORTING
|
| 193 |
+
MS: 4 ShuffleBytes-ManualDict-CrossOver-PersAutoDict- DE: "foo"-"bar"-; base unit: 8fc7da8d952ed1aa5c7415e21b3d52b42402973d
|
| 194 |
+
0x66,0x6f,0x6f,0x63,0x6f,0x75,0x6f,0x75,0x63,0x68,0x63,0x68,0x66,0x62,0x61,0x72,0x6f,0x6f,0x6d,0x67,0x66,0x6f,0x6f,0x2f,0x99,0x6f,0x6f,0x90,0x6f,0x6f,0x6d,0x0,0x0,0x67,0x2f,
|
| 195 |
+
foocououchchfbaroomgfoo/\231oo\220oom\000\000g/
|
| 196 |
+
artifact_prefix='/tmp/tmp9p1w4p8r/'; Test unit written to /tmp/tmp9p1w4p8r/crash-f8a2a1e84f58a2d676e5ad8078119a39b78df901
|
| 197 |
+
Base64: Zm9vY291b3VjaGNoZmJhcm9vbWdmb28vmW9vkG9vbQAAZy8=
|
| 198 |
+
stat::number_of_executed_units: 366
|
| 199 |
+
stat::average_exec_per_sec: 0
|
| 200 |
+
stat::new_units_added: 11
|
| 201 |
+
stat::slowest_unit_time_sec: 0
|
| 202 |
+
stat::peak_rss_mb: 33
|
local-test-tika-delta-03/fuzz-tooling/infra/cifuzz/test_data/external-project/Makefile
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Copyright 2017 Google Inc. All Rights Reserved.
|
| 2 |
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
| 3 |
+
|
| 4 |
+
# Simple example of a build file that nicely integrates a fuzz target
|
| 5 |
+
# with the rest of the project.
|
| 6 |
+
#
|
| 7 |
+
# We use 'make' as the build system, but these ideas are applicable
|
| 8 |
+
# to any other build system
|
| 9 |
+
|
| 10 |
+
# By default, use our own standalone_fuzz_target_runner.
|
| 11 |
+
# This runner does no fuzzing, but simply executes the inputs
|
| 12 |
+
# provided via parameters.
|
| 13 |
+
# Run e.g. "make all LIB_FUZZING_ENGINE=/path/to/libFuzzer.a"
|
| 14 |
+
# to link the fuzzer(s) against a real fuzzing engine.
|
| 15 |
+
#
|
| 16 |
+
# OSS-Fuzz will define its own value for LIB_FUZZING_ENGINE.
|
| 17 |
+
LIB_FUZZING_ENGINE ?= standalone_fuzz_target_runner.o
|
| 18 |
+
|
| 19 |
+
# Values for CC, CFLAGS, CXX, CXXFLAGS are provided by OSS-Fuzz.
|
| 20 |
+
# Outside of OSS-Fuzz use the ones you prefer or rely on the default values.
|
| 21 |
+
# Do not use the -fsanitize=* flags by default.
|
| 22 |
+
# OSS-Fuzz will use different -fsanitize=* flags for different builds (asan, ubsan, msan, ...)
|
| 23 |
+
|
| 24 |
+
# You may add extra compiler flags like this:
|
| 25 |
+
CXXFLAGS += -std=c++11
|
| 26 |
+
|
| 27 |
+
all: do_stuff_fuzzer
|
| 28 |
+
|
| 29 |
+
clean:
|
| 30 |
+
rm -fv *.a *.o *_fuzzer crash-* *.zip
|
| 31 |
+
|
| 32 |
+
# Fuzz target, links against $LIB_FUZZING_ENGINE, so that
|
| 33 |
+
# you may choose which fuzzing engine to use.
|
| 34 |
+
do_stuff_fuzzer: do_stuff_fuzzer.cpp my_api.a standalone_fuzz_target_runner.o
|
| 35 |
+
${CXX} ${CXXFLAGS} $< my_api.a ${LIB_FUZZING_ENGINE} -o $@
|
| 36 |
+
|
| 37 |
+
|
| 38 |
+
# The library itself.
|
| 39 |
+
my_api.a: my_api.cpp my_api.h
|
| 40 |
+
${CXX} ${CXXFLAGS} $< -c
|
| 41 |
+
ar ruv my_api.a my_api.o
|
| 42 |
+
|
| 43 |
+
# The standalone fuzz target runner.
|
| 44 |
+
standalone_fuzz_target_runner.o: standalone_fuzz_target_runner.cpp
|
local-test-tika-delta-03/fuzz-tooling/infra/cifuzz/test_data/external-project/do_stuff_fuzzer.cpp
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// Copyright 2020 Google LLC
|
| 2 |
+
//
|
| 3 |
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
| 4 |
+
// you may not use this file except in compliance with the License.
|
| 5 |
+
// You may obtain a copy of the License at
|
| 6 |
+
//
|
| 7 |
+
// http://www.apache.org/licenses/LICENSE-2.0
|
| 8 |
+
//
|
| 9 |
+
// Unless required by applicable law or agreed to in writing, software
|
| 10 |
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
| 11 |
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 12 |
+
// See the License for the specific language governing permissions and
|
| 13 |
+
// limitations under the License.
|
| 14 |
+
#include "my_api.h"
|
| 15 |
+
|
| 16 |
+
#include <string>
|
| 17 |
+
|
| 18 |
+
// Simple fuzz target for DoStuff().
|
| 19 |
+
// See https://llvm.org/docs/LibFuzzer.html for details.
|
| 20 |
+
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
|
| 21 |
+
std::string str(reinterpret_cast<const char *>(data), size);
|
| 22 |
+
DoStuff(str); // Disregard the output.
|
| 23 |
+
return 0;
|
| 24 |
+
}
|
local-test-tika-delta-03/fuzz-tooling/infra/cifuzz/test_data/external-project/do_stuff_fuzzer.dict
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# A dictionary for more efficient fuzzing of DoStuff().
|
| 2 |
+
# If the inputs contain multi-byte tokens, list them here.
|
| 3 |
+
# See https://llvm.org/docs/LibFuzzer.html#dictionaries
|
| 4 |
+
"foo"
|
| 5 |
+
"bar"
|
| 6 |
+
"ouch"
|
local-test-tika-delta-03/fuzz-tooling/infra/cifuzz/test_data/external-project/my_api.cpp
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// Copyright 2020 Google LLC
|
| 2 |
+
//
|
| 3 |
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
| 4 |
+
// you may not use this file except in compliance with the License.
|
| 5 |
+
// You may obtain a copy of the License at
|
| 6 |
+
//
|
| 7 |
+
// http://www.apache.org/licenses/LICENSE-2.0
|
| 8 |
+
//
|
| 9 |
+
// Unless required by applicable law or agreed to in writing, software
|
| 10 |
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
| 11 |
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 12 |
+
// See the License for the specific language governing permissions and
|
| 13 |
+
// limitations under the License.
|
| 14 |
+
|
| 15 |
+
// Implementation of "my_api".
|
| 16 |
+
#include "my_api.h"
|
| 17 |
+
|
| 18 |
+
#include <vector>
|
| 19 |
+
|
| 20 |
+
// Do some computations with 'str', return the result.
|
| 21 |
+
// This function contains a bug. Can you spot it?
|
| 22 |
+
size_t DoStuff(const std::string &str) {
|
| 23 |
+
std::vector<int> Vec({0, 1, 2, 3, 4});
|
| 24 |
+
size_t Idx = 0;
|
| 25 |
+
if (str.size() > 5)
|
| 26 |
+
Idx++;
|
| 27 |
+
if (str.find("foo") != std::string::npos)
|
| 28 |
+
Idx++;
|
| 29 |
+
if (str.find("bar") != std::string::npos)
|
| 30 |
+
Idx++;
|
| 31 |
+
if (str.find("ouch") != std::string::npos)
|
| 32 |
+
Idx++;
|
| 33 |
+
if (str.find("omg") != std::string::npos)
|
| 34 |
+
Idx++;
|
| 35 |
+
return Vec[Idx];
|
| 36 |
+
}
|
local-test-tika-delta-03/fuzz-tooling/infra/cifuzz/test_data/external-project/standalone_fuzz_target_runner.cpp
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// Copyright 2020 Google LLC
|
| 2 |
+
//
|
| 3 |
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
| 4 |
+
// you may not use this file except in compliance with the License.
|
| 5 |
+
// You may obtain a copy of the License at
|
| 6 |
+
//
|
| 7 |
+
// http://www.apache.org/licenses/LICENSE-2.0
|
| 8 |
+
//
|
| 9 |
+
// Unless required by applicable law or agreed to in writing, software
|
| 10 |
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
| 11 |
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 12 |
+
// See the License for the specific language governing permissions and
|
| 13 |
+
// limitations under the License.
|
| 14 |
+
|
| 15 |
+
// Example of a standalone runner for "fuzz targets".
|
| 16 |
+
// It reads all files passed as parameters and feeds their contents
|
| 17 |
+
// one by one into the fuzz target (LLVMFuzzerTestOneInput).
|
| 18 |
+
// This runner does not do any fuzzing, but allows us to run the fuzz target
|
| 19 |
+
// on the test corpus (e.g. "do_stuff_test_data") or on a single file,
|
| 20 |
+
// e.g. the one that comes from a bug report.
|
| 21 |
+
|
| 22 |
+
#include <cassert>
|
| 23 |
+
#include <iostream>
|
| 24 |
+
#include <fstream>
|
| 25 |
+
#include <vector>
|
| 26 |
+
|
| 27 |
+
// Forward declare the "fuzz target" interface.
|
| 28 |
+
// We deliberately keep this inteface simple and header-free.
|
| 29 |
+
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size);
|
| 30 |
+
|
| 31 |
+
int main(int argc, char **argv) {
|
| 32 |
+
for (int i = 1; i < argc; i++) {
|
| 33 |
+
std::ifstream in(argv[i]);
|
| 34 |
+
in.seekg(0, in.end);
|
| 35 |
+
size_t length = in.tellg();
|
| 36 |
+
in.seekg (0, in.beg);
|
| 37 |
+
std::cout << "Reading " << length << " bytes from " << argv[i] << std::endl;
|
| 38 |
+
// Allocate exactly length bytes so that we reliably catch buffer overflows.
|
| 39 |
+
std::vector<char> bytes(length);
|
| 40 |
+
in.read(bytes.data(), bytes.size());
|
| 41 |
+
assert(in);
|
| 42 |
+
LLVMFuzzerTestOneInput(reinterpret_cast<const uint8_t *>(bytes.data()),
|
| 43 |
+
bytes.size());
|
| 44 |
+
std::cout << "Execution successful" << std::endl;
|
| 45 |
+
}
|
| 46 |
+
return 0;
|
| 47 |
+
}
|
local-test-tika-delta-03/fuzz-tooling/infra/pytest.ini
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[pytest]
|
| 2 |
+
python_files = *_test.py
|
| 3 |
+
log_cli = true
|
local-test-tika-delta-03/fuzz-tooling/infra/repo_manager_test.py
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Copyright 2019 Google LLC
|
| 2 |
+
#
|
| 3 |
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
| 4 |
+
# you may not use this file except in compliance with the License.
|
| 5 |
+
# You may obtain a copy of the License at
|
| 6 |
+
#
|
| 7 |
+
# http://www.apache.org/licenses/LICENSE-2.0
|
| 8 |
+
#
|
| 9 |
+
# Unless required by applicable law or agreed to in writing, software
|
| 10 |
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
| 11 |
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 12 |
+
# See the License for the specific language governing permissions and
|
| 13 |
+
# limitations under the License.
|
| 14 |
+
"""Test the functionality of the RepoManager class."""
|
| 15 |
+
|
| 16 |
+
import contextlib
|
| 17 |
+
import os
|
| 18 |
+
import tempfile
|
| 19 |
+
import unittest
|
| 20 |
+
from unittest import mock
|
| 21 |
+
|
| 22 |
+
import repo_manager
|
| 23 |
+
import utils
|
| 24 |
+
|
| 25 |
+
# pylint: disable=protected-access
|
| 26 |
+
|
| 27 |
+
OSS_FUZZ_REPO_URL = 'https://github.com/google/oss-fuzz'
|
| 28 |
+
|
| 29 |
+
|
| 30 |
+
@contextlib.contextmanager
|
| 31 |
+
def get_oss_fuzz_repo():
|
| 32 |
+
"""Clones a temporary copy of the OSS-Fuzz repo. Returns the path to the
|
| 33 |
+
repo."""
|
| 34 |
+
repo_name = 'oss-fuzz'
|
| 35 |
+
with tempfile.TemporaryDirectory() as tmp_dir:
|
| 36 |
+
repo_manager._clone(OSS_FUZZ_REPO_URL, tmp_dir, repo_name)
|
| 37 |
+
yield os.path.join(tmp_dir, repo_name)
|
| 38 |
+
|
| 39 |
+
|
| 40 |
+
class CloneTest(unittest.TestCase):
|
| 41 |
+
"""Tests the _clone function."""
|
| 42 |
+
|
| 43 |
+
@unittest.skipIf(not os.getenv('INTEGRATION_TESTS'),
|
| 44 |
+
'INTEGRATION_TESTS=1 not set')
|
| 45 |
+
def test_clone_valid_repo_integration(self):
|
| 46 |
+
"""Integration test that tests the correct location of the git repo."""
|
| 47 |
+
with get_oss_fuzz_repo() as oss_fuzz_repo:
|
| 48 |
+
git_path = os.path.join(oss_fuzz_repo, '.git')
|
| 49 |
+
self.assertTrue(os.path.isdir(git_path))
|
| 50 |
+
|
| 51 |
+
def test_clone_invalid_repo(self):
|
| 52 |
+
"""Tests that cloning an invalid repo will fail."""
|
| 53 |
+
with tempfile.TemporaryDirectory() as tmp_dir:
|
| 54 |
+
with self.assertRaises(RuntimeError):
|
| 55 |
+
repo_manager._clone('https://github.com/oss-fuzz-not-real.git', tmp_dir,
|
| 56 |
+
'oss-fuzz')
|
| 57 |
+
|
| 58 |
+
@mock.patch('utils.execute')
|
| 59 |
+
def test_clone_with_username(self, mock_execute): # pylint: disable=no-self-use
|
| 60 |
+
"""Test clone with username."""
|
| 61 |
+
repo_manager._clone('https://github.com/fake/repo.git',
|
| 62 |
+
'/',
|
| 63 |
+
'name',
|
| 64 |
+
username='user',
|
| 65 |
+
password='password')
|
| 66 |
+
mock_execute.assert_called_once_with([
|
| 67 |
+
'git', 'clone', 'https://user:password@github.com/fake/repo.git', 'name'
|
| 68 |
+
],
|
| 69 |
+
location='/',
|
| 70 |
+
check_result=True,
|
| 71 |
+
log_command=False)
|
| 72 |
+
|
| 73 |
+
|
| 74 |
+
@unittest.skipIf(not os.getenv('INTEGRATION_TESTS'),
|
| 75 |
+
'INTEGRATION_TESTS=1 not set')
|
| 76 |
+
class RepoManagerCheckoutTest(unittest.TestCase):
|
| 77 |
+
"""Tests the checkout functionality of RepoManager."""
|
| 78 |
+
|
| 79 |
+
def test_checkout_valid_commit(self):
|
| 80 |
+
"""Tests that the git checkout command works."""
|
| 81 |
+
with get_oss_fuzz_repo() as oss_fuzz_repo:
|
| 82 |
+
repo_man = repo_manager.RepoManager(oss_fuzz_repo)
|
| 83 |
+
commit_to_test = '04ea24ee15bbe46a19e5da6c5f022a2ffdfbdb3b'
|
| 84 |
+
repo_man.checkout_commit(commit_to_test)
|
| 85 |
+
self.assertEqual(commit_to_test, repo_man.get_current_commit())
|
| 86 |
+
|
| 87 |
+
def test_checkout_invalid_commit(self):
|
| 88 |
+
"""Tests that the git checkout invalid commit fails."""
|
| 89 |
+
with get_oss_fuzz_repo() as oss_fuzz_repo:
|
| 90 |
+
repo_man = repo_manager.RepoManager(oss_fuzz_repo)
|
| 91 |
+
with self.assertRaises(ValueError):
|
| 92 |
+
repo_man.checkout_commit(' ')
|
| 93 |
+
with self.assertRaises(ValueError):
|
| 94 |
+
repo_man.checkout_commit('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')
|
| 95 |
+
with self.assertRaises(ValueError):
|
| 96 |
+
repo_man.checkout_commit('not-a-valid-commit')
|
| 97 |
+
|
| 98 |
+
|
| 99 |
+
@unittest.skipIf(not os.getenv('INTEGRATION_TESTS'),
|
| 100 |
+
'INTEGRATION_TESTS=1 not set')
|
| 101 |
+
class RepoManagerGetCommitListTest(unittest.TestCase):
|
| 102 |
+
"""Tests the get_commit_list method of RepoManager."""
|
| 103 |
+
|
| 104 |
+
def test_get_valid_commit_list(self):
|
| 105 |
+
"""Tests an accurate commit list can be retrieved from the repo manager."""
|
| 106 |
+
with get_oss_fuzz_repo() as oss_fuzz_repo:
|
| 107 |
+
repo_man = repo_manager.RepoManager(oss_fuzz_repo)
|
| 108 |
+
old_commit = '04ea24ee15bbe46a19e5da6c5f022a2ffdfbdb3b'
|
| 109 |
+
new_commit = 'fa662173bfeb3ba08d2e84cefc363be11e6c8463'
|
| 110 |
+
commit_list = [
|
| 111 |
+
'fa662173bfeb3ba08d2e84cefc363be11e6c8463',
|
| 112 |
+
'17035317a44fa89d22fe6846d868d4bf57def78b',
|
| 113 |
+
'97dee00a3c4ce95071c3e061592f5fd577dea886',
|
| 114 |
+
'04ea24ee15bbe46a19e5da6c5f022a2ffdfbdb3b'
|
| 115 |
+
]
|
| 116 |
+
result_list = repo_man.get_commit_list(new_commit, old_commit)
|
| 117 |
+
self.assertListEqual(commit_list, result_list)
|
| 118 |
+
|
| 119 |
+
def test_get_invalid_commit_list(self):
|
| 120 |
+
"""Tests that the proper errors are thrown when invalid commits are
|
| 121 |
+
passed to get_commit_list."""
|
| 122 |
+
with get_oss_fuzz_repo() as oss_fuzz_repo:
|
| 123 |
+
repo_man = repo_manager.RepoManager(oss_fuzz_repo)
|
| 124 |
+
old_commit = '04ea24ee15bbe46a19e5da6c5f022a2ffdfbdb3b'
|
| 125 |
+
new_commit = 'fa662173bfeb3ba08d2e84cefc363be11e6c8463'
|
| 126 |
+
with self.assertRaises(ValueError):
|
| 127 |
+
repo_man.get_commit_list('fakecommit', new_commit)
|
| 128 |
+
with self.assertRaises(ValueError):
|
| 129 |
+
repo_man.get_commit_list(new_commit, 'fakecommit')
|
| 130 |
+
with self.assertRaises(RuntimeError):
|
| 131 |
+
repo_man.get_commit_list(old_commit, new_commit) # pylint: disable=arguments-out-of-order
|
| 132 |
+
|
| 133 |
+
|
| 134 |
+
@unittest.skipIf(not os.getenv('INTEGRATION_TESTS'),
|
| 135 |
+
'INTEGRATION_TESTS=1 not set')
|
| 136 |
+
class GitDiffTest(unittest.TestCase):
|
| 137 |
+
"""Tests get_git_diff."""
|
| 138 |
+
|
| 139 |
+
def test_diff_exists(self):
|
| 140 |
+
"""Tests that a real diff is returned when a valid repo manager exists."""
|
| 141 |
+
with get_oss_fuzz_repo() as oss_fuzz_repo:
|
| 142 |
+
repo_man = repo_manager.RepoManager(oss_fuzz_repo)
|
| 143 |
+
with mock.patch.object(utils,
|
| 144 |
+
'execute',
|
| 145 |
+
return_value=('test.py\ndiff.py', None, 0)):
|
| 146 |
+
diff = repo_man.get_git_diff()
|
| 147 |
+
self.assertCountEqual(diff, ['test.py', 'diff.py'])
|
| 148 |
+
|
| 149 |
+
def test_diff_empty(self):
|
| 150 |
+
"""Tests that None is returned when there is no difference between repos."""
|
| 151 |
+
with get_oss_fuzz_repo() as oss_fuzz_repo:
|
| 152 |
+
repo_man = repo_manager.RepoManager(oss_fuzz_repo)
|
| 153 |
+
with mock.patch.object(utils, 'execute', return_value=('', None, 0)):
|
| 154 |
+
diff = repo_man.get_git_diff()
|
| 155 |
+
self.assertIsNone(diff)
|
| 156 |
+
|
| 157 |
+
def test_error_on_command(self):
|
| 158 |
+
"""Tests that None is returned when the command errors out."""
|
| 159 |
+
with get_oss_fuzz_repo() as oss_fuzz_repo:
|
| 160 |
+
repo_man = repo_manager.RepoManager(oss_fuzz_repo)
|
| 161 |
+
with mock.patch.object(utils,
|
| 162 |
+
'execute',
|
| 163 |
+
return_value=('', 'Test error.', 1)):
|
| 164 |
+
diff = repo_man.get_git_diff()
|
| 165 |
+
self.assertIsNone(diff)
|
| 166 |
+
|
| 167 |
+
def test_diff_no_change(self):
|
| 168 |
+
"""Tests that None is returned when there is no difference between repos."""
|
| 169 |
+
with get_oss_fuzz_repo() as oss_fuzz_repo:
|
| 170 |
+
repo_man = repo_manager.RepoManager(oss_fuzz_repo)
|
| 171 |
+
diff = repo_man.get_git_diff()
|
| 172 |
+
self.assertIsNone(diff)
|
| 173 |
+
|
| 174 |
+
|
| 175 |
+
@unittest.skipIf(not os.getenv('INTEGRATION_TESTS'),
|
| 176 |
+
'INTEGRATION_TESTS=1 not set')
|
| 177 |
+
class CheckoutPrIntegrationTest(unittest.TestCase):
|
| 178 |
+
"""Does Integration tests on the checkout_pr method of RepoManager."""
|
| 179 |
+
|
| 180 |
+
def test_pull_request_exists(self):
|
| 181 |
+
"""Tests that a diff is returned when a valid PR is checked out."""
|
| 182 |
+
with get_oss_fuzz_repo() as oss_fuzz_repo:
|
| 183 |
+
repo_man = repo_manager.RepoManager(oss_fuzz_repo)
|
| 184 |
+
repo_man.checkout_pr('refs/pull/3415/merge')
|
| 185 |
+
diff = repo_man.get_git_diff()
|
| 186 |
+
self.assertCountEqual(diff, ['README.md'])
|
| 187 |
+
|
| 188 |
+
def test_checkout_invalid_pull_request(self):
|
| 189 |
+
"""Tests that the git checkout invalid pull request fails."""
|
| 190 |
+
with get_oss_fuzz_repo() as oss_fuzz_repo:
|
| 191 |
+
repo_man = repo_manager.RepoManager(oss_fuzz_repo)
|
| 192 |
+
with self.assertRaises(RuntimeError):
|
| 193 |
+
repo_man.checkout_pr(' ')
|
| 194 |
+
with self.assertRaises(RuntimeError):
|
| 195 |
+
repo_man.checkout_pr('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')
|
| 196 |
+
with self.assertRaises(RuntimeError):
|
| 197 |
+
repo_man.checkout_pr('not/a/valid/pr')
|
| 198 |
+
|
| 199 |
+
|
| 200 |
+
if __name__ == '__main__':
|
| 201 |
+
unittest.main()
|
local-test-tika-delta-03/fuzz-tooling/infra/test
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
|
local-test-tika-delta-03/fuzz-tooling/infra/tools/wycheproof/.gitignore
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
wycheproof.zip
|
local-test-tika-delta-03/fuzz-tooling/infra/tools/wycheproof/generate_job.py
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
# Copyright 2022 Google LLC
|
| 3 |
+
#
|
| 4 |
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
# you may not use this file except in compliance with the License.
|
| 6 |
+
# You may obtain a copy of the License at
|
| 7 |
+
#
|
| 8 |
+
# http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
#
|
| 10 |
+
# Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
# See the License for the specific language governing permissions and
|
| 14 |
+
# limitations under the License.
|
| 15 |
+
#
|
| 16 |
+
################################################################################
|
| 17 |
+
"""Script for generating an OSS-Fuzz job for a wycheproof project."""
|
| 18 |
+
import sys
|
| 19 |
+
|
| 20 |
+
|
| 21 |
+
def main():
|
| 22 |
+
"""Usage generate_job.py <project>."""
|
| 23 |
+
project = sys.argv[1]
|
| 24 |
+
print(f'Name: wycheproof_nosanitizer_{project}')
|
| 25 |
+
job_definition = f"""CUSTOM_BINARY = False
|
| 26 |
+
BAD_BUILD_CHECK = False
|
| 27 |
+
APP_NAME = WycheproofTarget.bash
|
| 28 |
+
THREAD_ALIVE_CHECK_INTERVAL = 10
|
| 29 |
+
TEST_TIMEOUT = 3600
|
| 30 |
+
CRASH_RETRIES = 1
|
| 31 |
+
AGGREGATE_COVERAGE = False
|
| 32 |
+
TESTCASE_COVERAGE = False
|
| 33 |
+
FILE_GITHUB_ISSUE = False
|
| 34 |
+
MANAGED = False
|
| 35 |
+
MAX_FUZZ_THREADS = 1
|
| 36 |
+
RELEASE_BUILD_BUCKET_PATH = gs://clusterfuzz-builds-wycheproof/{project}/{project}-none-([0-9]+).zip
|
| 37 |
+
PROJECT_NAME = {project}
|
| 38 |
+
SUMMARY_PREFIX = {project}
|
| 39 |
+
REVISION_VARS_URL = https://commondatastorage.googleapis.com/clusterfuzz-builds-wycheproof/{project}/{project}-none-%s.srcmap.json
|
| 40 |
+
FUZZ_LOGS_BUCKET = {project}-logs.clusterfuzz-external.appspot.com
|
| 41 |
+
CORPUS_BUCKET = {project}-corpus.clusterfuzz-external.appspot.com
|
| 42 |
+
QUARANTINE_BUCKET = {project}-quarantine.clusterfuzz-external.appspot.com
|
| 43 |
+
BACKUP_BUCKET = {project}-backup.clusterfuzz-external.appspot.com
|
| 44 |
+
AUTOMATIC_LABELS = Proj-{project},Engine-wycheproof
|
| 45 |
+
"""
|
| 46 |
+
print(job_definition)
|
| 47 |
+
|
| 48 |
+
|
| 49 |
+
if __name__ == '__main__':
|
| 50 |
+
main()
|
local-test-tika-delta-03/fuzz-tooling/infra/tools/wycheproof/run.py
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
# Copyright 2022 Google LLC
|
| 3 |
+
#
|
| 4 |
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
# you may not use this file except in compliance with the License.
|
| 6 |
+
# You may obtain a copy of the License at
|
| 7 |
+
#
|
| 8 |
+
# http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
#
|
| 10 |
+
# Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
# See the License for the specific language governing permissions and
|
| 14 |
+
# limitations under the License.
|
| 15 |
+
#
|
| 16 |
+
################################################################################
|
| 17 |
+
"""Script for creating "testcases" to run wycheproof on."""
|
| 18 |
+
|
| 19 |
+
import argparse
|
| 20 |
+
import os
|
| 21 |
+
import sys
|
| 22 |
+
|
| 23 |
+
|
| 24 |
+
def get_args():
|
| 25 |
+
"""Returns parsed program arguments."""
|
| 26 |
+
parser = argparse.ArgumentParser()
|
| 27 |
+
parser.add_argument(
|
| 28 |
+
'--input_dir',
|
| 29 |
+
help='Ignored.',
|
| 30 |
+
)
|
| 31 |
+
parser.add_argument('--output_dir',
|
| 32 |
+
help='Directory for writing testcases.',
|
| 33 |
+
required=True)
|
| 34 |
+
parser.add_argument('--no_of_files', type=int, help='Ignored.')
|
| 35 |
+
return parser.parse_args()
|
| 36 |
+
|
| 37 |
+
|
| 38 |
+
def main():
|
| 39 |
+
"""Generates a dummy testcase for use by a ClusterFuzz blackbox fuzzer."""
|
| 40 |
+
args = get_args()
|
| 41 |
+
if not os.path.exists(args.output_dir):
|
| 42 |
+
os.mkdir(args.output_dir)
|
| 43 |
+
testcase = os.path.join(args.output_dir, 'fuzz-0')
|
| 44 |
+
with open(testcase, 'w') as file_handle:
|
| 45 |
+
file_handle.write(' ')
|
| 46 |
+
return 0
|
| 47 |
+
|
| 48 |
+
|
| 49 |
+
if __name__ == '__main__':
|
| 50 |
+
sys.exit(main())
|
local-test-tika-delta-03/fuzz-tooling/tools/vscode-extension/.editorconfig
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
root = true
|
| 2 |
+
|
| 3 |
+
[*]
|
| 4 |
+
indent_style = space
|
| 5 |
+
indent_size = 2
|
| 6 |
+
end_of_line = lf
|
| 7 |
+
charset = utf-8
|
| 8 |
+
insert_final_newline = true
|