578 Commits

Author SHA1 Message Date
Andrea Fioraldi
40269a578b
Delete blob and add CI check (#867)
* Delete blob and add CI check

* fix

* shellcheck
2022-10-27 16:20:29 +02:00
Andrea Fioraldi
ebdab32b36
Fix clap in fuzzbench fuzzers (#866) 2022-10-26 14:06:14 +02:00
Andrea Fioraldi
5da5997b20
Remove fuzzbench_weighted and update fuzzbench (#865) 2022-10-26 11:24:34 +02:00
Patrick Gersch
cf9c4188c0
Disabling qemu dependecies for qemu fullsystem (#737)
* Disabling qemu dependecies by default

* Adding full emulation_mode support

* Removing usermode from libafl_qemu default features

* Fixing refactoring

* Fixing typo in systemmode

* Fixing clippy:needless-borrow

* Mark libafl_load/save_qemu_snapshot as unused + cpu_reset

* Fixing clippy::needless-borrow

* Fixing needless-borrow yet again

* reset_cpu -> cpu_reset

* Fixing github workflow yet again

* Fixing clippy::uninlined-format-args

* Adding current libafl_qemu_bridge

Co-authored-by: Andrea Fioraldi <andreafioraldi@gmail.com>
2022-10-25 14:16:11 +02:00
Andrea Fioraldi
5571a03641
Implement thread-safe AsanGiovese in Rust with snapshots support (#851)
* Purge C impl of asan-giovese

* Compiling

* reset asan

* Restore asan state in qemu

* clippy

* upd

* Asan snapshots

* fuzzbench_qemu

* fix snap mmap limit

* fix

* compiles again

* clippy

* update meminterval

* autofix

* fix 32 bit targets

* try to clean intermediate builds

Co-authored-by: Dominik Maier <dmnk@google.com>
2022-10-25 09:48:59 +02:00
Dominik Maier
663a33168e
Associated types for Corpus, State (#767)
* Associated types for Corpus, State

* cleanup

* fix no_std

* drop unused clauses

* Corpus

* cleanup

* adding things

* fixed fuzzer

* remove phantom data

* python

* progress?

* more more

* oof

* wow it builds?

* python fixes, tests

* fix python fun

* black fmt for python

* clippy, added Nop things

* fixes

* fix merge

* make it compile (#836)

* doc-test fixes, prelude-b-gone for cargo-hack compat

* fixes for windows, concolic

* really fix windows, maybe

* imagine using windows

* ...

* elide I generic when used with S: State

* Elide many, many generics, but at what cost?

* progress on push

* Constraint HasCorpus, HasSolutions at trait definition

* remove unused feature

* remove unstable usage since we constrained HasCorpus at definition

* compiled, but still no type inference for MaxMapFeedback

* cleanup inprocess

* resolve some std conflicts

* simplify map

* undo unnecessary cfg specification

* fix breaking test case for CI on no-std

* fix concolic build failures

* fix macos build

* fixes for windows build

* timeout fixes for windows build

* fix pybindings issues

* fixup qemu

* fix outstanding local build issues

* maybe fix windows inprocess

* doc fixes

* unbridled fury

* de-associate State from Feedback, replace with generic as AT inference is not sufficient to derive specialisation for MapFeedback

* merge update

* refactor + speed up fuzzer builds by sharing build work

* cleanup lingering compiler errors

* lol missed one

* revert QEMU-Nyx change, not sure how I did that

* move HasInput to inputs

* HasInput => KnowsInput

* update bounds to enforce via associated types

* disentangle observers with fuzzer

* revert --target; update some fuzzers to match new API

* resolve outstanding fuzzer build blockers (that I can run on my system)

* fixes for non-linux unixes

* fix for windows

* Knows => Uses, final fixes for windows

* <guttural screaming>

* fixes for concolic

* loosen bound for frida executor so windows builds correctly

* cleanup generics for eventmanager/eventprocessor to drop observers requirement

* improve inference over fuzz_one and friends

* update migration notes

* fixes for python bindings

* fixes for generic counts in event managers

* finish migration notes

* post-merge fix

Co-authored-by: Addison Crump <addison.crump@cispa.de>
2022-10-24 03:22:26 +02:00
Dominik Maier
9695ce0029
Refactor Output Observers (#856)
* Refactor Output Observers

* Delete .gitmodules

* modules

* Drop need for OutputObserving list
2022-10-24 02:50:00 +02:00
Alessandro Mantovani
0307dadcd1
Allow two different observers for DiffExecutor (#843)
* DifferentialExecutor for CommandExecutor along with StdIO observer

* format

* fix CI issues

* fix format and unit test

* fix documentation

* allow three structs and doc only for linux

* resolve documentation test failure

* minor

* running fmt_all.sh

* into_executor() takes 4 params, not just 1

Co-authored-by: Dominik Maier <domenukk@gmail.com>
2022-10-23 01:59:40 +02:00
Mrmaxmeier
64bc5d5bdb
CI: speedups and fixes (#855)
* scripts/clippy.sh: remove cargo clean step

Clippy used to only report warnings in code that was not part of the
incremental cache. This has changed since and I believe we can safely
drop the `cargo clean` step.

* Revert "ci: install z3 to avoid building from source"

This reverts commit 6ff1c4088811040dcfdbd12273f0baf507a4308b.
This doesn't do anything as we're using `static-link-z3` explicitly.

* refactor test_all_fuzzers

nyx tests were not included in `time_record` before this

* nyx fuzzer: move modprobe logic out of setup_libxml2.sh
2022-10-23 01:58:33 +02:00
Mrmaxmeier
cedcee01c0
CI: Build fuzzers with shared cargo target dir (#845)
* build fuzzers with shared cargo target dir

* Make external build scripts aware of CARGO_TARGET_DIR

* fix libmozjpeg fuzzer with shared target dir

* fix cargo-make default value for CARGO_TARGET_DIR

* avoid ./ in cargo-make for windows compat

* CI: cargo-hack's --feature-powerset is too powerful

* fuzzer_concolic: support CARGO_TARGET_DIR

* ci: install z3 to avoid building from source

* ci: update actions

* ci: test nightly features with nightly rust

* test_all_fuzzers: try pruning more compilation artifacts

* ci: fix nightly feature check

* ci: apply rust-cache action after checkout (d'oh)

The rust-cache action populates the checkout directory, which is promply
deleted by the checkout action during checkout.. whoops!
2022-10-20 21:38:58 +02:00
Dominik Maier
28ab5e224b
Fix baby_no_std (#846)
* Fixing baby_no_std

* Fixed warnings for no_std

* Fix aarch build, clippy

* oops nyx again

* Using CString from alloc
2022-10-19 14:14:10 +02:00
Dominik Maier
e8b3d33bf4
Update dependencies, removed unused deps, CI fixes (#839)
* update clap, remove unused deps

* update grammartek

* update pyo3

* update pyo3

* undid clap update

* not changing nyx

* updated deps

* Update more deps, fixes

* not needed clippy

* fix windows

* try to enable deprecated pyproto for pyo3

* unused

* moving some things to clap4 after all

* initial move to clap 4

* fix clap

* more clap4, removed accidental file

* fixes, fmt

* fix

* all fix no play

* fix
2022-10-18 20:36:43 +02:00
Khangaroo
d6d4fa506b
Fix memory leaks and module instrumentation in frida_gdiplus (#841)
* Fix memory leaks and module instrumentation in frida_gdiplus

* Run clang-format
2022-10-17 10:02:45 +09:00
Mrmaxmeier
f5cc354102
Token mutations: set MutationResult for CmpValues::Bytes (#838)
* token mutations: set MutationResult for CmpValues::Bytes

I haven't measured this and am not even sure if CmpValues::Bytes is
currently populated by any executor, but this seems like an oversight.

* replace dead zlib-1.2.12.tar.gz URL

See https://zlib.net/fossils/OBSOLETE
2022-10-14 13:03:57 +02:00
Andrea Fioraldi
089bc49d55
Bump to 0.8.2 and update versions script (#828) 2022-10-12 14:57:08 +02:00
expend20
8fa4bca2d9
Hook IsProcessorFeaturePresent to crash with STATUS_STACK_BUFFER_OVERRUN exception (#804)
* First working attempt

* formatting issues

* Safety comment

* got rid of mutex

* Pass gum as a parameter

* removed debug println

* Review comments

* review: switched back to panic
2022-10-05 22:26:19 +02:00
Dongjia "toka" Zhang
57d1e4fba6
Fix Doc 2022-10-05 20:13:46 +02:00
Dongjia "toka" Zhang
fd24c49740
Format (#816)
* Update build_and_test.yml

* Update build_and_test.yml

* Update build_and_test.yml

* fmt

* Update build_and_test.yml

* Update build_and_test.yml

* rev

* rev
2022-10-05 18:05:03 +02:00
Dominik Maier
b7d93a4bea
Hide prelude behind feature flag (#782)
* Hide prelude behind feature flag

* make prelude default
2022-09-30 20:30:28 +02:00
Dongjia "toka" Zhang
6dc7cc2f59
bump (#799) 2022-09-25 09:41:01 +02:00
Dongjia "toka" Zhang
08864f2d53
Fix CI (#798) 2022-09-24 19:57:03 +02:00
expend20
f6bd99fc4d
Gdiplus comments (#792)
* Attempt to remove clang 12 setup

* frida_gdiplus added to CI

* Redundancy note

* formatting again :\

* mistake of directory name
2022-09-19 11:05:13 +02:00
expend20
eebc412fb4
Windows gdiplus (#789)
* Initial steps

* Harness code cleanup

* don't panic on linux in order not to break the CI

* formatting once again

* restored cfg unix to unbreak linux build
2022-09-18 15:33:25 +02:00
Dongjia "toka" Zhang
d17269d3d5
Stability improve (#773)
* initial

* add

* fmt & fix

* dbg remove

* clp

* clp

* more

* clippy

* del

* fix

* remove unused

* fix

* doc
2022-09-12 18:08:07 +02:00
Addison Crump
0859c3ace2
Implement a corpus minimiser (cmin) (#739)
* initial try

* correct case where cull attempts to fetch non-existent corpus entries

* various on_remove, on_replace implementations

* ise -> ize (consistency), use TestcaseScore instead of rolling our own

* oops, feature gate

* documentation!

* link c++

* doc-nit: correction in opt explanation

don't write documentation at 0300

* better linking
2022-08-29 13:38:46 +02:00
Addison Crump
d6e72560dc
Add test case minimising stage (tmin) (#735)
* add test case minimising stage

* general purpose minimiser impl, with fuzzer example

* reorganise, document, and other cleanup

* correct python API return value

* correct some docs

* nit: versioning in fuzzers

* ise -> ize
2022-08-29 13:37:55 +02:00
Aiden Hall
fc349bb7b1
Fix spelling error (#745) 2022-08-26 16:48:32 +02:00
syheliel
758e49ac70
NYX Executor (GSoC '22) (#693)
* Add ccache

* Update codecov.yml

* Add libnyx

* Fix

* Add nyx build script

* Fix build.sh && init executor.rs

* Fix commit

* Fix code

* initialize `exector.rs`

* refine API in `nyx_bridge.rs`

* initialze `run_target`

* add `test_nyxhelper`

* initize `test_executor`

* remove `nyx_beidge.rs`

* make `test_executor` compile

* Improve test

* refine code

* update version

* fix docker

* fix docker

* Fix clippy

* Fix build

* fix build && add `set_timeout`

* Fix and refine CI

* fix CI

* Fix CI

* Add platform restrict

* cargo fmt

* add parallel mode

* add example `nyx_libxml2_parallel`

* fix fuzzer example

* fix CI

* add README

* fix CI

* fix CI

* fix CI

* remove unwrap and NyxResult

* code format fix

* add libnyx's rev

* fix format

* change Duration format && Fix CI

* caego fmt

* fix CI

* fix CI

* Add doc

* test CI

* Update test_all_fuzzers.sh

* Update test_all_fuzzers.sh

* Update test_all_fuzzers.sh

* add cache for apt and cargo-install

* Update build_and_test.yml

* Update build_and_test.yml

* tmp test CI

* fix CI

* remove debug cmd

* remove test

* code refine

* code refine

* code refine

* code refine

* add Makefile

* fix example doc for nyx

* add `NyxHelper::new_with_initial_timeout`

* fix `NyxHelper::new`

* fix curl parameter

* code refine

* add check for setup script

* use afl-clang-fast in nyx

* fix logic

* fix makefile

* fix CI

* Update build_and_test.yml

* Update build_and_test.yml

* remove debug cmd

Co-authored-by: syheliel <syheliel@gmail.com>
Co-authored-by: Dominik Maier <dmnk@google.com>
2022-08-25 10:55:35 +02:00
Dongjia Zhang
eac7307c5a
0.8.1 (#732) 2022-08-18 10:23:57 +02:00
Dongjia Zhang
ce5ac3968d
Fixing readme & docs (#730)
* fix

* fix

* add

* add

* fmt
2022-08-15 02:12:35 +02:00
Dongjia Zhang
5d9a19f955
Mac OS Autotokens (#723)
* mac_tokens

* more

* win fix

* fmt

* fmt c
2022-08-13 02:58:22 +02:00
syheliel
2504b6dae3
Add rustfmt.toml (#722)
* add `rustfmt.toml`

* format fix

Co-authored-by: syheliel <syheliel@gmail.com>
2022-08-12 02:28:32 +02:00
Dominik Maier
12052b5f1c
Remove num_cpus dependency (#717)
* Remove num_cpus dependency

* Fix build, remove more num_cpus
2022-08-03 07:49:32 +02:00
Patrick Gersch
b2a1e03703
Qemu arm launcher (#708)
* Adding qemu_arm_launcher crate

* Trying to fix qemu arm usermode

* Cargo fmt

* Adding CROSS_CC env

* Remove hardcoded arm-linux-gnueabi-gcc and replace by CROSS_CC

* Adding arm-linux-gnueabi-gcc to github workflows for ubuntu

* Fixing typo in apt install package

* Resetting LR after each fuzzing emulation

* Cargo fmt after merge conflict

* Using GuestAddr

* Compiling, running and running with artificial crash detection

* Adding dependencies for github workflow to cross compile for arm

* Fixing github workflow for ubuntu fuzzer

* arm-linux-binutils for mac in github workflows

* Qemu does not work for mac, no need to compile qemu_arm_launcher harness for it
2022-08-02 11:46:24 +02:00
Dongjia Zhang
376e3adfcd
Bump Frida, Capstone versions (#715)
* bump

* fix

* fix

* revert

* fix

* fmt

* fix
2022-08-01 16:53:39 +02:00
Dominik Maier
5a8bdae26f
Update requirements (#714)
* Update requirements

* more updates

* nits

* more updates

* update nix for fuzzers

* use any regex 1 instead of 1.6
2022-07-29 09:54:16 +02:00
Dongjia Zhang
a5248d0250
Change StdWeightedScheduler API (#712)
* change

* fmt
2022-07-27 14:17:45 +02:00
Dongjia Zhang
0aba272a7d
Update fuzzbench_weighted to EXPLORE, fix linking (#707)
* Explore+weighted

* fix

* fmt

Co-authored-by: Andrea Fioraldi <andreafioraldi@gmail.com>
2022-07-25 14:03:35 +02:00
Mrmaxmeier
321bcfeba1
Cleanup duplicate package warnings (#702)
* cleanup duplicate package warnings

* libmozjpeg fuzzer: disable png reading support

libmozjpeg's libpng support is not used by the fuzzing harness,
and the mozjpeg-4.0.3 release has a build system issue with
newish libpng versions.
2022-07-17 14:17:49 +02:00
s1341
c45b6be7e1
Bump rand version (#680)
* Bump rand version, dropping support for lain

* using lain version with fixed rand

Co-authored-by: Dominik Maier <dmnk@google.com>
2022-07-16 01:46:32 +02:00
Patrick Gersch
3ae3dc7c62
Fixes to TUI monitor if main thread panics (#699)
* Trying to fix the tui if the main thread panics

* cargo fmt

* Prettifying code
2022-07-16 01:45:53 +02:00
Dongjia Zhang
ffe8dbf6af
Bump to 0.8.0 (#696)
* upd

* more
2022-07-11 21:59:11 +02:00
Dongjia Zhang
66b5fe8678
Extend weighted scheduler (#685)
* extend

* fix

* fmt

* more fix
2022-06-29 09:43:42 +09:00
Dongjia Zhang
405a1919b8
Still fixing ci (#683)
* fix

* fix

* more

* cargo fixed??

* fixed??

* clp

* fix
2022-06-28 16:56:28 +09:00
Andrea Fioraldi
7147170240
New hooks for libafl_qemu (#673)
* new block and edge hooks

* Wrking new hooks

* no Pin, just box

* working call tracing

* invalidate_block flag

* working call stack tracking helper

* callstack push

* fixes

* py

* fixes

* clippy

* clippy

* gdb api

* kill introspection

* fix

* upd qemu

* upd qemu
2022-06-16 11:09:07 +02:00
Dongjia Zhang
c9f802a3b8
Improve map feedback/observer (#665)
* improve

* a

* fix it back

* more

* NO

* try

* fix python

* more

* specialize map map feedback with u8

* more

* fmt

* usable_count = len

* clp

* restore iterator based map feedback

* simd specialization

* optimize hitcounts

* fix hitcounts

* no_std

* moar unsafe

* fix

* clippy

* clippy

* opt non-specialized is_interesting

* fmt

* op post_exec

* cleanup

* even more

* allow

Co-authored-by: Andrea Fioraldi <andreafioraldi@gmail.com>
2022-06-10 10:14:12 +02:00
Andrea Fioraldi
323b8e23ee
LIBAFL_DEBUG_OUTPUT in Launcher and OnDiskTOMLMonitor to create fuzzer_stats (#666)
* LIBAFL_DEBUG_OUTPUT in launcher on unix

* OnDiskTOMLMonitor

* fix

* clp

* clippy

* fix

* fix

* allow all

Co-authored-by: tokatoka <tokazerkje@outlook.com>
2022-06-08 17:32:58 +02:00
Dongjia Zhang
bc6a032843
Windows CI for frida (#658)
* harness & makefile.toml

* Update build_and_test.yml

* Update build_and_test.yml

* Update build_and_test.yml

* rename

* no stdout

* Update harness_win.cpp

* Update harness_win.cpp

* Update Makefile.toml

* Update build_and_test.yml

* Update Makefile.toml

* Update Makefile.toml

* fix
2022-05-30 23:06:37 +02:00
Dominik Maier
3a5118fc02
Moved core_affinity to bolts (#655)
* moved core_affinity to bolts crate

* clippy

* fixes

* ubuntu

* ubuntu++

* moved core_affinity to os

* fixed more imports

* fixed imports

* fixed test

* moved core_affinity out of os

* added affinity

* moved to windows crate

* fmt

* some tiny fixes

* more win

* refactoring

* win?

* win?

* clp

* upd

* more

* copy & paste & fix

* clp

* try

* fix

* more

* fix

Co-authored-by: tokatoka <tokazerkje@outlook.com>
2022-05-30 10:02:46 +02:00
Dominik Maier
bfe69aea09
Format C/Cpp code in ./scripts/fmt_all.sh (#653)
* format all (clang format 13)

* added clang-format check

* re-add missing newline

* cargo doc was missing

* more brackets

* fixed fmt workflow

* clang format

* shellcheck

* install clang-format-13

* update ubuntu for maximum clang-formattability

* yml whitespaces

* fmt

* shellcheck only for .sh

* oops path

* ignored shellcheck warning
2022-05-29 03:23:02 +02:00