forked from google/fuzzbench
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Andrea Fioraldi <[email protected]>
- Loading branch information
1 parent
980b0a6
commit 95e39a6
Showing
36 changed files
with
836 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Copyright 2020 Google LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
ARG parent_image=gcr.io/fuzzbench/base-builder | ||
FROM $parent_image | ||
|
||
# Install wget to download afl_driver.cpp. Install libstdc++ to use llvm_mode. | ||
RUN apt-get update && \ | ||
apt-get install wget libstdc++-5-dev -y | ||
|
||
# Download and compile afl++ (v2.62d). | ||
# Build without Python support as we don't need it. | ||
# Set AFL_NO_X86 to skip flaky tests. | ||
RUN git clone https://github.com/AFLplusplus/AFLplusplus.git /afl && \ | ||
cd /afl && \ | ||
git checkout b3e77d3d500ea3c462b3eacdc338d57796f37c5d && \ | ||
sed -i 's/.*define MAP_SIZE_POW2.*/#define MAP_SIZE_POW2 17/g' include/config.h && \ | ||
AFL_NO_X86=1 make PYTHON_INCLUDE=/ && \ | ||
cd libdislocator && make && cd .. && \ | ||
cd llvm_mode && CXXFLAGS= make | ||
|
||
# Use afl_driver.cpp from LLVM as our fuzzing library. | ||
RUN wget https://raw.githubusercontent.com/llvm/llvm-project/5feb80e748924606531ba28c97fe65145c65372e/compiler-rt/lib/fuzzer/afl/afl_driver.cpp -O /afl/afl_driver.cpp && \ | ||
clang++ -stdlib=libc++ -std=c++11 -O2 -c /afl/afl_driver.cpp && \ | ||
ar ru /libAFLDriver.a *.o |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Copyright 2020 Google LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
"""Integration code for AFLplusplus fuzzer.""" | ||
|
||
from fuzzers.aflplusplus import fuzzer as aflplusplus_fuzzer | ||
|
||
# OUT environment variable is the location of build directory (default is /out). | ||
|
||
|
||
def build(): | ||
"""Build benchmark.""" | ||
aflplusplus_fuzzer.build("ctx") | ||
|
||
|
||
def fuzz(input_corpus, output_corpus, target_binary): | ||
"""Run fuzzer.""" | ||
aflplusplus_fuzzer.fuzz(input_corpus, output_corpus, target_binary) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Copyright 2020 Google LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
FROM gcr.io/fuzzbench/base-runner |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Copyright 2020 Google LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
ARG parent_image=gcr.io/fuzzbench/base-builder | ||
FROM $parent_image | ||
|
||
# Install wget to download afl_driver.cpp. Install libstdc++ to use llvm_mode. | ||
RUN apt-get update && \ | ||
apt-get install wget libstdc++-5-dev -y | ||
|
||
# Download and compile afl++ (v2.62d). | ||
# Build without Python support as we don't need it. | ||
# Set AFL_NO_X86 to skip flaky tests. | ||
RUN git clone https://github.com/AFLplusplus/AFLplusplus.git /afl && \ | ||
cd /afl && \ | ||
git checkout b3e77d3d500ea3c462b3eacdc338d57796f37c5d && \ | ||
sed -i 's/.*define MAP_SIZE_POW2.*/#define MAP_SIZE_POW2 18/g' include/config.h && \ | ||
AFL_NO_X86=1 make PYTHON_INCLUDE=/ && \ | ||
cd libdislocator && make && cd .. && \ | ||
cd llvm_mode && CXXFLAGS= make | ||
|
||
# Use afl_driver.cpp from LLVM as our fuzzing library. | ||
RUN wget https://raw.githubusercontent.com/llvm/llvm-project/5feb80e748924606531ba28c97fe65145c65372e/compiler-rt/lib/fuzzer/afl/afl_driver.cpp -O /afl/afl_driver.cpp && \ | ||
clang++ -stdlib=libc++ -std=c++11 -O2 -c /afl/afl_driver.cpp && \ | ||
ar ru /libAFLDriver.a *.o |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Copyright 2020 Google LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
"""Integration code for AFLplusplus fuzzer.""" | ||
|
||
from fuzzers.aflplusplus import fuzzer as aflplusplus_fuzzer | ||
|
||
# OUT environment variable is the location of build directory (default is /out). | ||
|
||
|
||
def build(): | ||
"""Build benchmark.""" | ||
aflplusplus_fuzzer.build("ctx") | ||
|
||
|
||
def fuzz(input_corpus, output_corpus, target_binary): | ||
"""Run fuzzer.""" | ||
aflplusplus_fuzzer.fuzz(input_corpus, output_corpus, target_binary) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Copyright 2020 Google LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
FROM gcr.io/fuzzbench/base-runner |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Copyright 2020 Google LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
ARG parent_image=gcr.io/fuzzbench/base-builder | ||
FROM $parent_image | ||
|
||
# Install wget to download afl_driver.cpp. Install libstdc++ to use llvm_mode. | ||
RUN apt-get update && \ | ||
apt-get install wget libstdc++-5-dev -y | ||
|
||
# Download and compile afl++ (v2.62d). | ||
# Build without Python support as we don't need it. | ||
# Set AFL_NO_X86 to skip flaky tests. | ||
RUN git clone https://github.com/AFLplusplus/AFLplusplus.git /afl && \ | ||
cd /afl && \ | ||
git checkout b3e77d3d500ea3c462b3eacdc338d57796f37c5d && \ | ||
AFL_NO_X86=1 make PYTHON_INCLUDE=/ && \ | ||
cd libdislocator && make && cd .. && \ | ||
cd llvm_mode && CXXFLAGS= make | ||
|
||
# Use afl_driver.cpp from LLVM as our fuzzing library. | ||
RUN wget https://raw.githubusercontent.com/llvm/llvm-project/5feb80e748924606531ba28c97fe65145c65372e/compiler-rt/lib/fuzzer/afl/afl_driver.cpp -O /afl/afl_driver.cpp && \ | ||
clang++ -stdlib=libc++ -std=c++11 -O2 -c /afl/afl_driver.cpp && \ | ||
ar ru /libAFLDriver.a *.o |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Copyright 2020 Google LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
"""Integration code for AFLplusplus fuzzer.""" | ||
|
||
from fuzzers.aflplusplus import fuzzer as aflplusplus_fuzzer | ||
|
||
# OUT environment variable is the location of build directory (default is /out). | ||
|
||
|
||
def build(): | ||
"""Build benchmark.""" | ||
aflplusplus_fuzzer.build("ctx") | ||
|
||
|
||
def fuzz(input_corpus, output_corpus, target_binary): | ||
"""Run fuzzer.""" | ||
aflplusplus_fuzzer.fuzz(input_corpus, | ||
output_corpus, | ||
target_binary, | ||
flags=("-p", "coe")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Copyright 2020 Google LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
FROM gcr.io/fuzzbench/base-runner |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Copyright 2020 Google LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
ARG parent_image=gcr.io/fuzzbench/base-builder | ||
FROM $parent_image | ||
|
||
# Install wget to download afl_driver.cpp. Install libstdc++ to use llvm_mode. | ||
RUN apt-get update && \ | ||
apt-get install wget libstdc++-5-dev -y | ||
|
||
# Download and compile afl++ (v2.62d). | ||
# Build without Python support as we don't need it. | ||
# Set AFL_NO_X86 to skip flaky tests. | ||
RUN git clone https://github.com/AFLplusplus/AFLplusplus.git /afl && \ | ||
cd /afl && \ | ||
git checkout b3e77d3d500ea3c462b3eacdc338d57796f37c5d && \ | ||
AFL_NO_X86=1 make PYTHON_INCLUDE=/ && \ | ||
cd libdislocator && make && cd .. && \ | ||
cd llvm_mode && CXXFLAGS= make | ||
|
||
# Use afl_driver.cpp from LLVM as our fuzzing library. | ||
RUN wget https://raw.githubusercontent.com/llvm/llvm-project/5feb80e748924606531ba28c97fe65145c65372e/compiler-rt/lib/fuzzer/afl/afl_driver.cpp -O /afl/afl_driver.cpp && \ | ||
clang++ -stdlib=libc++ -std=c++11 -O2 -c /afl/afl_driver.cpp && \ | ||
ar ru /libAFLDriver.a *.o |
Oops, something went wrong.