Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
129 commits
Select commit Hold shift + click to select a range
83dfd7c
retry tests with current fb
vanhauser-thc Apr 6, 2024
59bd82b
try different version
vanhauser-thc Apr 8, 2024
aaef9e9
try llvm 19
vanhauser-thc Apr 9, 2024
a3ffd4e
fix
vanhauser-thc May 18, 2024
9df48df
update
vanhauser-thc May 19, 2024
ba7c454
update
vanhauser-thc May 20, 2024
6f8e205
new weight test
vanhauser-thc May 23, 2024
7bc2136
update aflplusplus
vanhauser-thc May 23, 2024
bcc9f83
Merge branch 'master' into master
vanhauser-thc May 23, 2024
086e4b2
alternative
vanhauser-thc May 24, 2024
51408b5
push
vanhauser-thc May 27, 2024
300c54b
push
vanhauser-thc May 27, 2024
82a6857
fix
vanhauser-thc May 27, 2024
081fae7
regression check
vanhauser-thc May 28, 2024
18f9adf
rename
vanhauser-thc May 28, 2024
dc2ce26
regression test
vanhauser-thc May 30, 2024
b75e223
regression
vanhauser-thc May 30, 2024
3f7993f
next iteration
vanhauser-thc May 31, 2024
20e471b
more
vanhauser-thc May 31, 2024
6e036f5
hopefully found it
vanhauser-thc Jun 1, 2024
86ba4ac
fix attempt
vanhauser-thc Jun 1, 2024
323494f
cheap time test
vanhauser-thc Jun 2, 2024
6846629
new strategy
vanhauser-thc Jun 2, 2024
411be0b
fix
vanhauser-thc Jun 3, 2024
4e3c440
asan
vanhauser-thc Jun 4, 2024
028c426
model
vanhauser-thc Jun 4, 2024
703fe15
debug
vanhauser-thc Jun 4, 2024
4db226d
more debug
vanhauser-thc Jun 4, 2024
8a20bcd
update
vanhauser-thc Jun 5, 2024
103e9a0
allow -m settings
vanhauser-thc Jun 5, 2024
edc9a45
update asan
vanhauser-thc Jun 5, 2024
5f80067
update
vanhauser-thc Jun 5, 2024
e1e001e
add nn model test
vanhauser-thc Jun 5, 2024
b087349
regression analysis
vanhauser-thc Jun 5, 2024
b00496f
final testing
vanhauser-thc Jun 6, 2024
97677aa
regression analysis
vanhauser-thc Jun 7, 2024
eb8eac5
fix
vanhauser-thc Jun 8, 2024
d434472
fix
vanhauser-thc Jun 8, 2024
4bebec8
update
vanhauser-thc Jun 8, 2024
62a7499
final reg analysis
vanhauser-thc Jun 10, 2024
22df69d
coarse
vanhauser-thc Jun 10, 2024
fbc058d
fix
vanhauser-thc Jun 11, 2024
c0cc4b1
test new implementation
vanhauser-thc Jun 12, 2024
6f7e475
new mutations
vanhauser-thc Jun 22, 2024
55fe679
update afl++
vanhauser-thc Jun 22, 2024
ffb5ce5
newweight
vanhauser-thc Jun 23, 2024
2dc6a2c
fix
vanhauser-thc Jun 23, 2024
2f126b7
new splice
vanhauser-thc Jun 25, 2024
1661d42
exploit strat
vanhauser-thc Jun 28, 2024
6b18000
new
vanhauser-thc Jun 30, 2024
610fe69
leoC
vanhauser-thc Jul 1, 2024
6ba690b
fix
vanhauser-thc Jul 1, 2024
a070ef3
power schedule test
vanhauser-thc Jul 19, 2024
1fe22a3
fix
vanhauser-thc Jul 19, 2024
374315c
update
vanhauser-thc Jul 20, 2024
e65ae35
new
vanhauser-thc Jul 21, 2024
9f46fe6
Merge branch 'google:master' into master
vanhauser-thc Aug 2, 2024
20b4147
test change
vanhauser-thc Aug 2, 2024
83ab1bd
Merge branch 'google:master' into master
vanhauser-thc Aug 17, 2024
ef39463
fix
vanhauser-thc Aug 18, 2024
c5a87a2
Merge branch 'google:master' into master
vanhauser-thc Sep 2, 2024
c227f5b
update
vanhauser-thc Sep 2, 2024
db1e095
aarnav
vanhauser-thc Sep 3, 2024
9ff51c5
fix
vanhauser-thc Sep 3, 2024
283d761
debug
vanhauser-thc Sep 4, 2024
fc1db66
fix
vanhauser-thc Sep 5, 2024
8db43dd
no cmplog
vanhauser-thc Sep 9, 2024
74787f4
new version
vanhauser-thc Sep 19, 2024
43c5194
vp
vanhauser-thc Sep 20, 2024
259d4c5
fix
vanhauser-thc Sep 20, 2024
a4644bc
fix
vanhauser-thc Sep 20, 2024
d023b07
fix
vanhauser-thc Sep 20, 2024
c225402
Merge branch 'google:master' into master
vanhauser-thc Sep 21, 2024
f427cc3
fix
vanhauser-thc Sep 25, 2024
b6fca1f
Add libafl grimoire example for https://github.com/AFLplusplus/libafl…
tokatoka Oct 10, 2024
dc35825
Merge branch 'google:master' into master
vanhauser-thc Oct 17, 2024
12895f1
kfuzz test
vanhauser-thc Oct 17, 2024
c17928c
fix
vanhauser-thc Oct 17, 2024
0a84eb3
update kfuzz
vanhauser-thc Oct 18, 2024
ced1735
next
vanhauser-thc Oct 18, 2024
071e037
Update builder.Dockerfile
vanhauser-thc Oct 18, 2024
368a566
fix
vanhauser-thc Oct 21, 2024
ecf19c1
rename
vanhauser-thc Oct 21, 2024
717714e
libaflfuzz
vanhauser-thc Oct 23, 2024
7827495
new kfuzz
vanhauser-thc Oct 25, 2024
e1cc5e3
update
vanhauser-thc Nov 14, 2024
b5c5c54
update libaflfuzz
vanhauser-thc Nov 26, 2024
fe66f16
splice
vanhauser-thc Jan 8, 2025
91258dc
afl havoc test
vanhauser-thc Jan 8, 2025
2f38899
name fix
vanhauser-thc Jan 8, 2025
b70765f
fix
vanhauser-thc Jan 8, 2025
155eb4d
fix
vanhauser-thc Jan 8, 2025
04e6035
update mopt
vanhauser-thc Jan 9, 2025
b5806bc
less splice
vanhauser-thc Jan 10, 2025
6f42ccc
new afl++
vanhauser-thc Jan 13, 2025
8c732d0
new variant
vanhauser-thc Jan 14, 2025
9af6194
new
vanhauser-thc Jan 14, 2025
ff0d69c
mopt2
vanhauser-thc Jan 15, 2025
fc487de
fix
vanhauser-thc Jan 16, 2025
3820d66
set afl++ to 4.30c
vanhauser-thc Jan 17, 2025
44c8f3f
compare afl++ versions
vanhauser-thc Jan 17, 2025
26d4b70
splice
vanhauser-thc Jan 21, 2025
1204ad2
aflplusplus_san
vanhauser-thc Jan 24, 2025
821cdb7
pow2
vanhauser-thc Jan 29, 2025
19ff4c8
fix
vanhauser-thc Jan 30, 2025
d41650f
update libafl
vanhauser-thc Mar 10, 2025
4638e34
Merge branch 'google:master' into master
vanhauser-thc Mar 10, 2025
b73d89c
repetition fixseed
rmalmain Mar 26, 2025
7e0413f
use underscores instead of dashes for fuzzer names
rmalmain Mar 27, 2025
aff1970
non fix seed variant
tokatoka Apr 2, 2025
c22f331
add all buddies
tokatoka Apr 4, 2025
8ab9f52
mopt test
vanhauser-thc Apr 5, 2025
f14b9fc
fix
vanhauser-thc Apr 5, 2025
6de3b6f
no simlpify test
vanhauser-thc Apr 6, 2025
62587f6
deleting fox cuz it's vanished into the vast ocean of the internet. F…
Apr 10, 2025
a144e81
mopt_test
vanhauser-thc Apr 12, 2025
9e14cbd
remove
vanhauser-thc Apr 12, 2025
e4d5186
new tests
vanhauser-thc May 6, 2025
5a293b4
update instr
vanhauser-thc May 8, 2025
a70c339
update dev
vanhauser-thc May 9, 2025
7b779e4
update new instrumentation
vanhauser-thc May 11, 2025
99187b5
Merge branch 'master' into exp_repetition
tokatoka Jun 5, 2025
3aef0c5
add nothing and toka
Jun 5, 2025
173d8c3
Rename
Jun 6, 2025
595990a
rename
Jun 6, 2025
13f060e
-Z
tokatoka Jun 28, 2025
ce209fa
z option
tokatoka Jun 29, 2025
4d7e519
libfuzzer
Jul 2, 2025
0d3b5e3
seeded libfuzzer
rmalmain Sep 22, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
33 changes: 33 additions & 0 deletions fuzzers/afl_257/builder.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# 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
FROM $parent_image

# Download and compile AFL v2.57b.
# Set AFL_NO_X86 to skip flaky tests.
RUN git clone \
--depth 1 \
--branch v2.57b \
https://github.com/google/AFL.git /afl && \
cd /afl && \
CFLAGS= CXXFLAGS= AFL_NO_X86=1 make

# Use afl_driver.cpp from LLVM as our fuzzing library.
RUN apt-get update && \
apt-get install wget -y && \
wget https://raw.githubusercontent.com/llvm/llvm-project/5feb80e748924606531ba28c97fe65145c65372e/compiler-rt/lib/fuzzer/afl/afl_driver.cpp -O /afl/afl_driver.cpp && \
clang -Wno-pointer-sign -c /afl/llvm_mode/afl-llvm-rt.o.c -I/afl && \
clang++ -stdlib=libc++ -std=c++11 -O2 -c /afl/afl_driver.cpp && \
ar r /libAFL.a *.o
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ def get_stats(output_corpus, fuzzer_log): # pylint: disable=unused-argument
"""Gets fuzzer stats for AFL."""
# Get a dictionary containing the stats AFL reports.
stats_file = os.path.join(output_corpus, 'fuzzer_stats')
if not os.path.exists(stats_file):
print('Can\'t find fuzzer_stats')
return '{}'
with open(stats_file, encoding='utf-8') as file_handle:
stats_file_lines = file_handle.read().splitlines()
stats_file_dict = {}
Expand Down
32 changes: 32 additions & 0 deletions fuzzers/afl_mb/builder.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# 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
FROM $parent_image

# Download and compile AFL v2.57b.
# Set AFL_NO_X86 to skip flaky tests.
RUN git clone --depth 1 \
https://github.com/MagicHavoc/Havoc-Study
RUN mv Havoc-Study/fuzzers/Havoc_DMA /afl
RUN cd /afl && \
CFLAGS= CXXFLAGS= AFL_NO_X86=1 make

# Use afl_driver.cpp from LLVM as our fuzzing library.
RUN apt-get update && \
apt-get install wget -y && \
wget https://raw.githubusercontent.com/llvm/llvm-project/5feb80e748924606531ba28c97fe65145c65372e/compiler-rt/lib/fuzzer/afl/afl_driver.cpp -O /afl/afl_driver.cpp && \
clang -Wno-pointer-sign -c /afl/llvm_mode/afl-llvm-rt.o.c -I/afl && \
clang++ -stdlib=libc++ -std=c++11 -O2 -c /afl/afl_driver.cpp && \
ar r /libAFL.a *.o
3 changes: 3 additions & 0 deletions fuzzers/afl_virginmap/fuzzer.py → fuzzers/afl_mb/fuzzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ def get_stats(output_corpus, fuzzer_log): # pylint: disable=unused-argument
"""Gets fuzzer stats for AFL."""
# Get a dictionary containing the stats AFL reports.
stats_file = os.path.join(output_corpus, 'fuzzer_stats')
if not os.path.exists(stats_file):
print('Can\'t find fuzzer_stats')
return '{}'
with open(stats_file, encoding='utf-8') as file_handle:
stats_file_lines = file_handle.read().splitlines()
stats_file_dict = {}
Expand Down
33 changes: 33 additions & 0 deletions fuzzers/afl_t0/builder.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# 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
FROM $parent_image

# Download and compile AFL v2.57b.
# Set AFL_NO_X86 to skip flaky tests.
RUN git clone \
--depth 1 \
--branch v2.57b \
https://github.com/google/AFL.git /afl && \
cd /afl && \
CFLAGS= CXXFLAGS= AFL_NO_X86=1 make

# Use afl_driver.cpp from LLVM as our fuzzing library.
RUN apt-get update && \
apt-get install wget -y && \
wget https://raw.githubusercontent.com/llvm/llvm-project/5feb80e748924606531ba28c97fe65145c65372e/compiler-rt/lib/fuzzer/afl/afl_driver.cpp -O /afl/afl_driver.cpp && \
clang -Wno-pointer-sign -c /afl/llvm_mode/afl-llvm-rt.o.c -I/afl && \
clang++ -stdlib=libc++ -std=c++11 -O2 -c /afl/afl_driver.cpp && \
ar r /libAFL.a *.o
141 changes: 141 additions & 0 deletions fuzzers/afl_t0/fuzzer.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
# 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 AFL fuzzer."""

import json
import os
import shutil
import subprocess

from fuzzers import utils


def prepare_build_environment():
"""Set environment variables used to build targets for AFL-based
fuzzers."""
cflags = ['-fsanitize-coverage=trace-pc-guard']
utils.append_flags('CFLAGS', cflags)
utils.append_flags('CXXFLAGS', cflags)

os.environ['CC'] = 'clang'
os.environ['CXX'] = 'clang++'
os.environ['FUZZER_LIB'] = '/libAFL.a'


def build():
"""Build benchmark."""
prepare_build_environment()

utils.build_benchmark()

print('[post_build] Copying afl-fuzz to $OUT directory')
# Copy out the afl-fuzz binary as a build artifact.
shutil.copy('/afl/afl-fuzz', os.environ['OUT'])


def get_stats(output_corpus, fuzzer_log): # pylint: disable=unused-argument
"""Gets fuzzer stats for AFL."""
# Get a dictionary containing the stats AFL reports.
stats_file = os.path.join(output_corpus, 'fuzzer_stats')
if not os.path.exists(stats_file):
print('Can\'t find fuzzer_stats')
return '{}'
with open(stats_file, encoding='utf-8') as file_handle:
stats_file_lines = file_handle.read().splitlines()
stats_file_dict = {}
for stats_line in stats_file_lines:
key, value = stats_line.split(': ')
stats_file_dict[key.strip()] = value.strip()

# Report to FuzzBench the stats it accepts.
stats = {'execs_per_sec': float(stats_file_dict['execs_per_sec'])}
return json.dumps(stats)


def prepare_fuzz_environment(input_corpus):
"""Prepare to fuzz with AFL or another AFL-based fuzzer."""
# Tell AFL to not use its terminal UI so we get usable logs.
os.environ['AFL_NO_UI'] = '1'
# Skip AFL's CPU frequency check (fails on Docker).
os.environ['AFL_SKIP_CPUFREQ'] = '1'
# No need to bind affinity to one core, Docker enforces 1 core usage.
os.environ['AFL_NO_AFFINITY'] = '1'
# AFL will abort on startup if the core pattern sends notifications to
# external programs. We don't care about this.
os.environ['AFL_I_DONT_CARE_ABOUT_MISSING_CRASHES'] = '1'
# Don't exit when crashes are found. This can happen when corpus from
# OSS-Fuzz is used.
os.environ['AFL_SKIP_CRASHES'] = '1'
# Shuffle the queue
os.environ['AFL_SHUFFLE_QUEUE'] = '1'

# AFL needs at least one non-empty seed to start.
utils.create_seed_file_for_empty_corpus(input_corpus)


def check_skip_det_compatible(additional_flags):
""" Checks if additional flags are compatible with '-d' option"""
# AFL refuses to take in '-d' with '-M' or '-S' options for parallel mode.
# (cf. https://github.com/google/AFL/blob/8da80951/afl-fuzz.c#L7477)
if '-M' in additional_flags or '-S' in additional_flags:
return False
return True


def run_afl_fuzz(input_corpus,
output_corpus,
target_binary,
additional_flags=None,
hide_output=False):
"""Run afl-fuzz."""
# Spawn the afl fuzzing process.
print('[run_afl_fuzz] Running target with afl-fuzz')
command = [
'./afl-fuzz',
'-i',
input_corpus,
'-o',
output_corpus,
# Use no memory limit as ASAN doesn't play nicely with one.
'-m',
'none',
'-t',
'1000+', # Use same default 1 sec timeout, but add '+' to skip hangs.
]
# Use '-d' to skip deterministic mode, as long as it it compatible with
# additional flags.
if not additional_flags or check_skip_det_compatible(additional_flags):
command.append('-d')
if additional_flags:
command.extend(additional_flags)
dictionary_path = utils.get_dictionary_path(target_binary)
if dictionary_path:
command.extend(['-x', dictionary_path])
command += [
'--',
target_binary,
# Pass INT_MAX to afl the maximize the number of persistent loops it
# performs.
'2147483647'
]
print('[run_afl_fuzz] Running command: ' + ' '.join(command))
output_stream = subprocess.DEVNULL if hide_output else None
subprocess.check_call(command, stdout=output_stream, stderr=output_stream)


def fuzz(input_corpus, output_corpus, target_binary):
"""Run afl-fuzz on target."""
prepare_fuzz_environment(input_corpus)

run_afl_fuzz(input_corpus, output_corpus, target_binary)
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2021 Google LLC
# 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.
Expand All @@ -13,5 +13,3 @@
# limitations under the License.

FROM gcr.io/fuzzbench/base-image

ENV LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/out"
33 changes: 33 additions & 0 deletions fuzzers/afl_t1/builder.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# 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
FROM $parent_image

# Download and compile AFL v2.57b.
# Set AFL_NO_X86 to skip flaky tests.
RUN git clone \
--depth 1 \
--branch v2.57b \
https://github.com/google/AFL.git /afl && \
cd /afl && \
CFLAGS= CXXFLAGS= AFL_NO_X86=1 make

# Use afl_driver.cpp from LLVM as our fuzzing library.
RUN apt-get update && \
apt-get install wget -y && \
wget https://raw.githubusercontent.com/llvm/llvm-project/5feb80e748924606531ba28c97fe65145c65372e/compiler-rt/lib/fuzzer/afl/afl_driver.cpp -O /afl/afl_driver.cpp && \
clang -Wno-pointer-sign -c /afl/llvm_mode/afl-llvm-rt.o.c -I/afl && \
clang++ -stdlib=libc++ -std=c++11 -O2 -c /afl/afl_driver.cpp && \
ar r /libAFL.a *.o
Loading