1450 Commits

Author SHA1 Message Date
s1341
1608294d0b
Various fixes related to frida mode (#445)
* Fix lint errors

* Fix incorrect address for unfreed allocations when reseting

* Use hash for edge ids

* Fmt
2022-01-03 10:41:52 +01:00
Evan Richter
9f6872ac68
[libafl_qemu] fix i386 Regs values (#444)
The `Regs` enum was defined out of order, leading to incorrect results from `emu.read_reg`. I found the correct ordering defined here: https://github.com/AFLplusplus/qemu-libafl-bridge/blob/master/target/i386/cpu.h#L46-L54
2022-01-03 10:41:29 +01:00
Dominik Maier
b9acac46d9
Cpu atomics for LLMP (#438)
* atomic read for unmap

* send and recv

* switching to Atomics

* atomics

* bring back compiler_fence (maybe needed for signals?)

* only acquire mem if new msg is available

* unused compiler fence

* caching for msg ids to not have to read atomics as much

* fix build

* speed++

* only in a spinloop for the second try

* cleanup logs

* docu, error log
2022-01-03 00:47:31 +01:00
Dominik Maier
af3d321213
Derive debug for all structs in LibAFL (#442)
* documentation, warnings

* fixed docs

* docs

* no_std

* test

* windows

* nautilus docs

* more fixes

* more docs

* nits

* windows clippy

* docs, windows

* nits

* debug all the things

* derive debug for all core library components

* Docu for libafl_targets

* nits

* reordered generics

* add docs to frida, debug

* nits

* fixes

* more docu for frida, nits

* more docu

* more docu

* Sugar docs

* debug for qemu

* more debug

* import debug

* fmt

* debug

* anyap_debug feature no longer needed

* tidy up unused fn

* indicate if we left out values for struct debug

* implement Debug for sugar

* debug allthethings

* ci
2022-01-03 00:47:17 +01:00
Dominik Maier
efc804fe7d
Updated dependencies (#443)
* updated dependencies

* updated info in toml

* Windows fixes

* fixed immport

* u32 -> i32

* ignore i32 overflows in constants

* removed unused double allow
2022-01-02 17:52:44 +01:00
Evan Richter
9f76386668
[libafl_qemu] prevent unneeded build.rs runs (#441)
`libqasan/libqasan.so` never exists during a normal `cargo build` because the .so is built in the target_dir, not in the source directory. This was triggering cargo to rerun the build script every time a user of this library made an incremental change to their code.

pointing `rerun-if-changed` to a directory will make cargo rerun build.rs if any file in that directory changes.
2022-01-02 01:03:35 +01:00
Dominik Maier
cb3662da54
Enable errors for missing docs, add documentation (#440)
* documentation, warnings

* fixed docs

* docs

* no_std

* test

* windows

* nautilus docs

* more fixes

* more docs

* nits

* windows clippy

* docs, windows

* nits
2022-01-01 19:51:27 +01:00
Dominik Maier
d669b063f4 clippy 2021-12-30 18:38:28 +01:00
Dongjia Zhang
b537539b54
Use MiMalloc for in-process fuzzers (#439)
* MiMalloc

* docu

* other fuzzers

* mention asan
2021-12-30 16:33:23 +01:00
s1341
b5153cc525
Frida various fixes (#436)
* Make drcov post_exec dependent on whether drcov is enabled

* Fix find_smallest_fit algorithm

* Fix missing ?

* fix warnings

* fix

* todo for non-linux/android shadow, clippy

* typo

* removed unsupposted eq

* cleanup, docu

* libafl::Error

* fixed import

Co-authored-by: tokatoka <tokazerkje@outlook.com>
Co-authored-by: Dominik Maier <domenukk@gmail.com>
2021-12-29 18:47:33 +01:00
Evan Richter
e47c3be3fd
[libafl_qemu] fix build.rs (#435)
I noticed qemu was only building on one core, so I debugged the jobs environment variable. Evidently cargo passes `CARGO_BUILD_JOBS` is passed to build.rs scripts as `NUM_JOBS`. Other env vars for build.rs can be found [here](https://web.mit.edu/rust-lang_v1.25/arch/amd64_ubuntu1404/share/doc/rust/html/cargo/reference/environment-variables.html#environment-variables-cargo-sets-for-build-scripts)
2021-12-29 01:30:14 +01:00
s1341
eeac0f4f06
Fix strncmp hook to only check the length of the string (#434) 2021-12-28 10:00:44 +01:00
s1341
6384f1da95
Merge pull request #433 from AFLplusplus/frida_asan_max_total_allocation
Implement max total allocation size for frida asan
2021-12-27 11:49:40 +02:00
s1341
129cd0fe66
Merge pull request #432 from AFLplusplus/drcov_runtime
DrCov Runtime
2021-12-26 16:21:15 +02:00
s1341
2e92a34494 Reset total allocations on reset 2021-12-26 11:17:27 +02:00
s1341
11ae49b7cd Implement max total allocation size for frida asan 2021-12-26 10:44:25 +02:00
tokatoka
97c169fe63 init ranges later 2021-12-24 16:34:53 +09:00
tokatoka
e6434d2ec2 fmt 2021-12-24 15:46:27 +09:00
tokatoka
9cd0d2228c drcov runtime 2021-12-24 15:45:08 +09:00
Dominik Maier
6b5181250c
Drcov remodelling (#415)
* drcov remodelling

* fmt

* fix

Co-authored-by: tokatoka <tokazerkje@outlook.com>
2021-12-23 17:13:18 +01:00
Andrea Fioraldi
6274ad4594
Refactor libafl_qemu creating the Emulator struct and post syscall hooks (#430)
* working without asan.rs

* working asan

* update fuzzers

* mremap in snapshot

* sugar

* python

* fix python

* clippy

* fmt

* fuck you loader
2021-12-23 09:10:13 +01:00
Dongjia Zhang
d697554810
Other/User defined WIndows Exceptions (#402)
* other exceptions

* add

* 46th

* fix

* fmt
2021-12-21 19:18:58 +01:00
s1341
b0019ae4a9
Fix frida-mode for debug builds, ensure it will continue to work on release builds (#427)
* Fix cfg directives so that we actually build on all combinations of release/debug x86_64/aarch64

* Include fuzzer for stalker purposes

* Get rid of cfg on use
2021-12-21 14:30:47 +01:00
Andrea Fioraldi
785cddc1f0 Fix meson.build issue updating QEMU git hash 2021-12-21 12:42:41 +01:00
Andrea Fioraldi
208d69342d Update QEMU git hash 2021-12-21 11:35:06 +01:00
Andrea Fioraldi
d2bc09a31b Format 2021-12-21 11:28:08 +01:00
Andrea Fioraldi
0cce1e2b91 Update fuzzbench and fuzzbench_qemu, delete fuzzbench_gsoc 2021-12-21 11:26:04 +01:00
Dongjia Zhang
2aa0ca5ef1
Frida shadow fix (#425)
* map_to_shadow

* fix map_to_shadow

* aarch64 change?

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* use

* revert

* s1341's change

* Fix shadow calculation in instrumented code

* Fix asan error output to be more accurate

Co-authored-by: s1341 <github@shmarya.net>
2021-12-20 10:51:45 +01:00
van Hauser
1f24ad0b65
Implement AflMap (#416)
* aflmap

* nits

* nits

* switch implementation

* clippy

* set fuzzbench fuzzer to afl map

* fix monitor display

* Remove MapFindFilter and fix names

* AndReducer

* fixed testcase

* always inline

* remove inline(always)

Co-authored-by: Andrea Fioraldi <andreafioraldi@gmail.com>
Co-authored-by: Dominik Maier <domenukk@gmail.com>
2021-12-16 14:19:39 +01:00
Dongjia Zhang
6e59e5bdc7
Frida Refactor: Separate Frida other helper functions into each Runtime (#418)
* separate asan

* fmt

* move asan out of helper.rs

* fmt

* move cmplog out of helper.rs

* fmt

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* final fix & fmt

* Fix unused imports

* Fmt

* rename files

* fix Makefile

* fmt

* clippy

Co-authored-by: s1341 <github@shmarya.net>
Co-authored-by: Dominik Maier <domenukk@gmail.com>
2021-12-16 14:16:01 +01:00
Dongjia Zhang
79f9bcd3e0
Use AddVectoredExceptionHandler to register exception handlers (#403)
* add

* unix fix

* unsafe positions

* another unsafe!

* ignore

* ignore

* make changes back

* fix

* fix

* fmt

* exception fix

* fix

* bug fix

* fmt

* fix things messed up during merge

* stack overflow fix

* fix

* fix

* fix

Co-authored-by: Andrea Fioraldi <andreafioraldi@gmail.com>
Co-authored-by: Dominik Maier <domenukk@gmail.com>
2021-12-16 11:15:24 +01:00
s1341
d93f97309a
Open the stdout-file once (#419)
Co-authored-by: Dominik Maier <domenukk@gmail.com>
2021-12-16 11:12:40 +01:00
Dominik Maier
abfdb619a8 Remove cpp from CodeQL 2021-12-15 23:43:56 +01:00
Dominik Maier
d1eaf07423
Create codeql-analysis.yml 2021-12-15 23:38:27 +01:00
Dominik Maier
88e07a8d37 CI galore 2021-12-15 23:34:42 +01:00
Dominik Maier
d3245de5bd Even more CI 2021-12-15 21:37:22 +01:00
Dominik Maier
e72c579ebc more CI fixes 2021-12-15 19:07:43 +01:00
Dominik Maier
304eda724f
Various fixes for CI (#423)
* Various fixes

* fix try_from for cores

* no_std
2021-12-15 18:11:40 +01:00
Dominik Maier
a8845ccbe7
Fix makefile for frida_libpng (#422)
* fix Makefile

* revert unfinished changes from #418

Co-authored-by: tokatoka <tokazerkje@outlook.com>
2021-12-15 12:30:33 +01:00
Dominik Maier
217a7dee1d
Use Structopt instead of yaml for example fuzzers, introduce Cores API (#420)
* reworked generic_inmemory to structopt

* moved core parsing to a struct

* added Cores

* added structopt to libpng_ctx

* improved libafl, added structopt to libpng launcher

* fix deexit ub

* move more to structopt

* improve llvm-config detection

* move construct_automata to structopt

* clippy, fixes, ...

* no_std

* clippy

* frida core parsing

* fixed no-fork cores

* updated clap

* added missing import

* missing borrow

* reworked frida to structopt

* fixed build

* using Cores api for atheris

Co-authored-by: Dominik Maier <d.maier@avm.de>
2021-12-15 03:58:35 +01:00
Andrea Fioraldi
b4c2551544
Debug output for forkserver (#413)
* usability fixes for forkserver

* don't call target_bytes twice in TimeoutForkserverExecutor

* don't call target_bytes twice in ForkserverExecutor
2021-12-10 14:52:23 +01:00
Dongjia Zhang
4aa6550bf2
Clap: use help instead of about (#417) 2021-12-10 05:04:32 +01:00
Dongjia Zhang
a96e01fda5
Fix forkserver_simple clap issue (#412) 2021-12-10 03:38:42 +01:00
Dongjia Zhang
3fbe1be189
Fix timeout value type for Windows (#414) 2021-12-09 20:08:44 +01:00
Dominik Maier
98859fbf69
Symcc submodule referencing a path (#411) 2021-12-09 16:43:03 +01:00
Dongjia Zhang
fc0881194d
Windows timeout fix with critical sections (#391)
* add

* unix fix

* unsafe positions

* another unsafe!

* ignore

* ignore

* make changes back

* fix

* fix

* fmt

* bug fix

* fmt

* compiler fence

* import

* typo

* add another critical section

* fix

* fix

* exclude windows book test

* typo

* fence

* why

Co-authored-by: Andrea Fioraldi <andreafioraldi@gmail.com>
2021-12-09 13:55:20 +01:00
Andrea Fioraldi
c6553c5351 Use grammartec on crates 0.7.0 2021-12-09 09:58:19 +01:00
Andrea Fioraldi
7c7c7e679f Merge branch 'main' of github.com:AFLplusplus/LibAFL into main 2021-12-08 16:32:36 +01:00
Andrea Fioraldi
5af2b4580e Update pyo3 to 0.15 2021-12-08 16:32:32 +01:00
van Hauser
4a23489acb
Implement unstable edge detection+ignore in calibration stage (#398)
* step 1 for unstable calibration

* fmt

* fixed build

* done unstable implementation

* clippy

* finishing touches for unstable

* no_std

* fmt

* event mgr stablity

* fixed stability value

* displaying

* no_std

* fixed critical whitespace

* send msg only after calibration

* clippy

* Added log to mgr

* moved stability to state

* fix introspection

* space

* fixed docs

Co-authored-by: Dominik Maier <domenukk@gmail.com>
2021-12-08 09:54:47 +01:00