-
-
Notifications
You must be signed in to change notification settings - Fork 331
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce libafl-fuzz #2362
Merged
domenukk
merged 48 commits into
AFLplusplus:main
from
R9295:feature/libafl-fuzz-the-future-is-now
Jul 16, 2024
Merged
Introduce libafl-fuzz #2362
Changes from all commits
Commits
Show all changes
48 commits
Select commit
Hold shift + click to select a range
d5ab811
Introduce libafl-fuzz
R9295 3e9f2c3
fix corpus file path
R9295 a3fd1de
simplify SeedFeedback
R9295 e55e67d
Merge branch 'main' into feature/libafl-fuzz-the-future-is-now
tokatoka 5e486ef
fix incorrect comment
R9295 fb8b7df
add clap::ValueEnum to PowerSchedule as an optional derive if clap is…
R9295 755f062
UnixShMemProvider replaced with StdShMemProvider for libafl-fuzz
R9295 a8b13c6
remove io_error_more feature constraint
R9295 e283aef
libafl-fuzz: make Ok(()) unreachable in CentralizedLauncher
R9295 a95d663
libafl-fuzz: make harness_input_stdin to harness_input_type with &'st…
R9295 a7a41fd
libafl-fuzz: move each feedback to it's own file
R9295 4297149
make run_fuzzer_with_stage into a function.
R9295 5d9902a
remove unecessary clone
R9295 eb850cf
libafl-fuzz: cleanup AFLStatsStage
R9295 0c46399
move peak_rss_mb to libafl_bolts
R9295 29c1bcb
parse envs by hand
R9295 7122256
add sensible defaults for map size and broker port
R9295 b0af856
fix test.sh and corpus_id padding
R9295 3b49771
add Makefile.toml
R9295 d6d84da
Merge branch 'main' into feature/libafl-fuzz-the-future-is-now
R9295 9ff3b8f
libafl-fuzz update test suite
R9295 84ffeba
libafl-fuzz: clippy
R9295 43c61a4
rename peak_rss_mb to peak_rss_mb_children
R9295 d1e1622
remove minor version constraint for clap
R9295 c0f283c
libafl-fuzz: fix ELF check and instrumentation check in check_binary
R9295 b070f08
libafl-fuzz: improve Makefile.toml
R9295 288995c
simplify fuzzer and cleanup typos
R9295 fbd64af
libafl-fuzz: load corpus entries in a multicore fashion
R9295 f38fda5
libafl-fuzz: create output dir if not exists (non-racey)
R9295 a7d8547
Merge branch 'main' into feature/libafl-fuzz-the-future-is-now
R9295 2aff5ec
Merge branch 'main' into feature/libafl-fuzz-the-future-is-now
domenukk 7b9ed40
libafl-fuzz: add sequential scheduling support
R9295 22fd014
rename peak_rss_mb_children to peak_rss_mb_child_processes
R9295 a1b0ff8
fix race condition in SyncFromDiskStage, add interval based checking …
R9295 405aff2
update README
R9295 1a69483
implement AflScheduler for QueueScheduler.
R9295 1d278bc
libafl-fuzz: remove dependecy on SchedulerMetadata for AflStatsStage
R9295 a142afa
clippy
R9295 09ebcce
remove queue_cycles from AflScheduler into int's own trait.
R9295 6499eb5
clippy
R9295 445f479
libafl-fuzz: disable cmplog check in CI for now
R9295 0939df6
Merge branch 'main' into feature/libafl-fuzz-the-future-is-now
R9295 020fccd
add missing constraints for libafl_qemu executor
R9295 c16645e
clippy
R9295 3ca79fe
libafl-fuzz: improve Makefile
R9295 33a167d
libafl-fuzz: misc
R9295 b58e23d
misc typos, beautify
R9295 d9ca434
Merge branch 'main' into feature/libafl-fuzz-the-future-is-now
R9295 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
[package] | ||
name = "libafl-fuzz" | ||
version = "0.0.1" | ||
edition = "2021" | ||
|
||
[dependencies] | ||
clap = { version = "4.5", features = ["derive", "env"] } | ||
env_logger = "0.11.3" | ||
libafl = { path = "../../libafl", features = ["std", "derive", "track_hit_feedbacks", "clap", "errors_backtrace"]} | ||
libafl_bolts = { path = "../../libafl_bolts", features = ["std", "errors_backtrace"]} | ||
libafl_targets = { path = "../../libafl_targets"} | ||
memmap2 = "0.9.4" | ||
nix = {version = "0.29", features = ["fs"]} | ||
regex = "1.10.5" | ||
serde = { version = "1.0.117", features = ["derive"] } | ||
|
||
[features] | ||
default = ["track_hit_feedbacks"] | ||
track_hit_feedbacks = ["libafl/track_hit_feedbacks"] |
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,66 @@ | ||
[env] | ||
PROJECT_DIR = { script = ["pwd"] } | ||
CARGO_TARGET_DIR = { value = "${PROJECT_DIR}/target", condition = { env_not_set = ["CARGO_TARGET_DIR"] } } | ||
PROFILE = { value = "release", condition = {env_not_set = ["PROFILE"]} } | ||
PROFILE_DIR = {value = "release", condition = {env_not_set = ["PROFILE_DIR"] }} | ||
FUZZER_NAME = 'libafl-fuzz' | ||
FUZZER = '${CARGO_TARGET_DIR}/${PROFILE_DIR}/${FUZZER_NAME}' | ||
LLVM_CONFIG = {value = "llvm-config-18", condition = {env_not_set = ["LLVM_CONFIG"] }} | ||
AFL_VERSION = "4.21c" | ||
AFL_DIR_NAME= {value = "./AFLplusplus-${AFL_VERSION}"} | ||
AFL_CC_PATH= {value = "${AFL_DIR_NAME}/afl-clang-fast"} | ||
|
||
|
||
[tasks.build_afl] | ||
script_runner="@shell" | ||
script=''' | ||
if [ ! -d "$AFL_DIR_NAME" ]; then | ||
if [ -f "v${AFL_VERSION}.zip" ]; then | ||
rm v${AFL_VERSION}.zip | ||
fi | ||
wget https://github.com/AFLplusplus/AFLplusplus/archive/refs/tags/v${AFL_VERSION}.zip | ||
unzip v${AFL_VERSION}.zip | ||
cd ${AFL_DIR_NAME} | ||
LLVM_CONFIG=${LLVM_CONFIG} make | ||
cd .. | ||
fi | ||
|
||
''' | ||
# Test | ||
[tasks.test] | ||
linux_alias = "test_unix" | ||
mac_alias = "test_unix" | ||
windows_alias = "unsupported" | ||
|
||
[tasks.test_unix] | ||
script_runner="@shell" | ||
script=''' | ||
cargo build --profile ${PROFILE} | ||
AFL_PATH=${AFL_DIR_NAME} ${AFL_CC_PATH} ./test/test-instr.c -o ./test/out-instr | ||
AFL_CORES=1 AFL_STATS_INTERVAL=1 timeout 5 ${FUZZER} -i ./test/seeds -o ./test/output ./test/out-instr || true | ||
test -n "$( ls ./test/output/fuzzer_main/queue/id:000002* 2>/dev/null )" || exit 1 | ||
test -n "$( ls ./test/output/fuzzer_main/fuzzer_stats 2>/dev/null )" || exit 1 | ||
test -n "$( ls ./test/output/fuzzer_main/plot_data 2>/dev/null )" || exit 1 | ||
test -d "./test/output/fuzzer_main/hangs" || exit 1 | ||
test -d "./test/output/fuzzer_main/crashes" || exit 1 | ||
|
||
# cmplog TODO: AFL_BENCH_UNTIL_CRASH=1 instead of timeout 15s | ||
#AFL_LLVM_CMPLOG=1 AFL_PATH=${AFL_DIR_NAME} ${AFL_CC_PATH} ./test/test-cmplog.c -o ./test/out-cmplog | ||
#AFL_CORES=1 timeout 15 ${FUZZER} -Z -l 3 -m 0 -V30 -i ./test/seeds_cmplog -o ./test/cmplog-output -c ./test/out-cmplog ./test/out-cmplog >>errors 2>&1 | ||
#test -n "$( ls ./test/cmplog-output/fuzzer_main/crashes/id:000000* ./test/cmplog-output/hangs/id:000000* 2>/dev/null )" || exit 1 | ||
''' | ||
dependencies = ["build_afl"] | ||
|
||
[tasks.clean] | ||
linux_alias = "clean_unix" | ||
mac_alias = "clean_unix" | ||
windows_alias = "unsupported" | ||
|
||
[tasks.clean_unix] | ||
script_runner="@shell" | ||
script=''' | ||
rm -rf AFLplusplus-${AFL_VERSION} | ||
rm v${AFL_VERSION}.zip | ||
rm -rf ./test/out-instr | ||
rm -rf ./test/output | ||
''' |
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,70 @@ | ||
Rewrite of afl-fuzz in Rust. | ||
|
||
# TODO | ||
- [x] AFL_HANG_TMOUT | ||
- [x] AFL_NO_AUTODICT | ||
- [x] AFL_MAP_SIZE | ||
- [x] AFL_KILL_SIGNAL | ||
- [x] AFL_BENCH_JUST_ONE | ||
- [x] AFL_DEBUG_CHILD | ||
- [x] AFL_PERSISTENT | ||
- [x] AFL_IGNORE_TIMEOUTS | ||
- [x] AFL_EXIT_ON_SEED_ISSUES | ||
- [x] AFL_BENCH_UNTIL_CRASH | ||
- [x] AFL_TMPDIR | ||
- [x] AFL_CRASH_EXITCODE | ||
- [x] AFL_TARGET_ENV | ||
- [x] AFL_IGNORE_SEED_PROBLEMS (renamed to AFL_IGNORE_SEED_ISSUES) | ||
- [x] AFL_CRASH_EXITCODE | ||
- [x] AFL_INPUT_LEN_MIN | ||
- [x] AFL_INPUT_LEN_MAX | ||
- [x] AFL_CYCLE_SCHEDULES | ||
- [x] AFL_CMPLOG_ONLY_NEW | ||
- [x] AFL_PRELOAD | ||
- [x] AFL_SKIP_BIN_CHECK | ||
- [x] AFL_NO_STARTUP_CALIBRATION (this is default in libafl, not sure if this needs to be changed?) | ||
- [x] AFL_FUZZER_STATS_UPDATE_INTERVAL | ||
- [x] AFL_DEFER_FORKSRV | ||
- [x] AFL_NO_WARN_INSTABILITY (we don't warn anyways, we should maybe?) | ||
- [x] AFL_SYNC_TIME | ||
- [ ] AFL_FINAL_SYNC | ||
- [x] AFL_AUTORESUME | ||
- [ ] AFL_CRASHING_SEEDS_AS_NEW_CRASH | ||
- [ ] AFL_IGNORE_UNKNOWN_ENVS | ||
- [ ] AFL_NO_UI | ||
- [ ] AFL_PIZZA_MODE :) | ||
- [ ] AFL_EXIT_WHEN_DONE | ||
- [ ] AFL_EXIT_ON_TIME | ||
- [ ] AFL_NO_AFFINITY | ||
- [ ] AFL_FORKSERVER_KILL_SIGNAL | ||
- [ ] AFL_EXPAND_HAVOC_NOW | ||
- [ ] AFL_NO_FORKSRV | ||
- [ ] AFL_FORKSRV_INIT_TMOUT | ||
- [ ] AFL_TRY_AFFINITY | ||
- [ ] AFL_FAST_CAL | ||
- [ ] AFL_NO_CRASH_README | ||
- [ ] AFL_KEEP_TIMEOUTS | ||
- [ ] AFL_PERSISTENT_RECORD | ||
- [ ] AFL_TESTCACHE_SIZE | ||
- [ ] AFL_NO_ARITH | ||
- [ ] AFL_DISABLE_TRIM | ||
- [ ] AFL_MAX_DET_EXTRAS | ||
- [ ] AFL_IGNORE_PROBLEMS | ||
- [ ] AFL_IGNORE_PROBLEMS_COVERAGE | ||
- [ ] AFL_STATSD_TAGS_FLAVOR | ||
- [ ] AFL_STATSD | ||
- [ ] AFL_STATSD_PORT | ||
- [ ] AFL_STATSD_HOST | ||
- [ ] AFL_IMPORT | ||
- [x] AFL_IMPORT_FIRST (implicit) | ||
- [ ] AFL_SHUFFLE_QUEUE | ||
- [ ] AFL_CUSTOM_QEMU_BIN | ||
- [ ] AFL_PATH | ||
- [ ] AFL_CUSTOM_MUTATOR_LIBRARY | ||
- [ ] AFL_CUSTOM_MUTATOR_ONLY | ||
- [ ] AFL_PYTHON_MODULE | ||
- [ ] AFL_DEBUG | ||
- [ ] AFL_I_DONT_CARE_ABOUT_MISSING_CRASHES | ||
- [ ] AFL_DUMB_FORKSRV | ||
- [ ] AFL_EARLY_FORKSERVER | ||
- [ ] AFL_NO_SNAPSHOT |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
someone (tm) should benchmark if this degrades performance - else it should be default
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
errors backtrace?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes