770 Commits

Author SHA1 Message Date
Andrea Fioraldi
bd22ea5268
Merge pull request #78 from AFLplusplus/dev
Dev
0.1.0
2021-04-30 15:07:30 +02:00
Andrea Fioraldi
5b70724b14
Merge branch 'main' into dev 2021-04-30 15:06:12 +02:00
s1341
e3a95e2d70 frida_libpng: make test crash happen (much) less frequently 2021-04-30 15:55:27 +03:00
s1341
0019364ff6 frida-asan: get rid of traps left in by mistake 2021-04-30 15:49:36 +03:00
s1341
3e9e1492c8 Get rid of unneeded spin dependency 2021-04-30 15:43:31 +03:00
s1341
dea96ab59c frida: modules may be relative paths; move to ahash for filenames; fix tls bug 2021-04-30 15:35:40 +03:00
Dominik Maier
cdbbcd03a8
Update README.md 2021-04-30 11:41:04 +02:00
vanhauser-thc
7c041a2d71 rust installation help 2021-04-30 11:33:59 +02:00
Andrea Fioraldi
662e362e42 Merge branch 'dev' of github.com:AFLplusplus/libAFLrs into dev 2021-04-30 11:05:52 +02:00
Andrea Fioraldi
8f4963fc2c fix readme 2021-04-30 11:05:44 +02:00
vanhauser-thc
96313f8717 fix typos 2021-04-30 11:05:25 +02:00
Andrea Fioraldi
2864d62d6d
Merge pull request #61 from AFLplusplus/dev
Dev
2021-04-30 10:59:10 +02:00
s1341
a6e21989e4 frida-asan: only unpoison readable/writeable memory
This significantly reduces the working set.
2021-04-30 09:46:32 +03:00
s1341
e62f4de6b5
Various fixes for frida-asan on aarch64-linux-android (#64) 2021-04-29 19:31:36 +02:00
Dominik Maier
f3b4305dac Refactored compression 2021-04-29 13:16:51 +02:00
Toka
9d748a887c
Add Llmp Compression Feature (#60), closes #46
* add compression

* modify event/llmp.rs

* rename to LLMP_TAG_COMPRESS

* remove compression code from bolts/llmp.rs

* add compress.rs

* handle compress & decompress in GzipCompress struct, compress if the size is large enough

* add code for benchmark

* remove LLMP_TAG_COMPRESS, use a flag instead

* cargo fmt

* rm test.sh

* passes the test

* comment benchmarks code out

* add recv_buf_with_flag()

* add the llmp_compress feature

* add send_buf, do not compile compression code if it's not used

* fix warning

* merged dev

* add error handling code

* doc for compress.rs

* remove tag from decompress

* rename every flag to flags

* fix some clippy.sh errors

* simplify recv_buf

* delete benchmark printf code

* cargo fmt

* fix doc

Co-authored-by: Dominik Maier <domenukk@gmail.com>
2021-04-29 12:36:12 +02:00
Dominik Maier
f9e4e7cbf0 initial strucutre layed out 2021-04-29 12:26:44 +02:00
Dominik Maier
10c1ce9d66 added bunny 2021-04-29 12:07:12 +02:00
Dominik Maier
9aa3f25287 reworked readme 2021-04-29 12:04:46 +02:00
Dominik Maier
dadc486452 added restarts to libfuzzer example, docu cleanup 2021-04-29 10:55:31 +02:00
Dominik Maier
454932ff91 added note about restarts 2021-04-29 09:23:42 +02:00
Dominik Maier
5ab480ac3e cargo clippy 2021-04-28 14:32:59 +02:00
Andrea Fioraldi
e418198e78 workspace default-members 2021-04-28 12:26:59 +02:00
andreafioraldi
6c035d13a3 cmplog and value profile MSVC fixes 2021-04-28 12:12:07 +02:00
andreafioraldi
4747a35936 MSVC fixes 2021-04-28 08:47:07 +02:00
andreafioraldi
8e544c59c6 readme 2021-04-28 08:27:31 +02:00
andreafioraldi
74a6f54751 readme 2021-04-28 08:17:33 +02:00
s1341
5c856cccc8
WIP: Implement ASAN instrumentation using frida (#45)
* frida_asan: Implemented initial asan runtime library

* frida_asan: Switch to hashbrown

* Implemented GOT-based hooking to isolate the hooking of the memory functions. Implemented initial ASAN instrumentation

* WIP: Shadowing all used memory. Currently tracking pages using a BTreeSet. Slow AF!

* Add SigTrap to unix_signals and inprocess

* Working frida-asan, almost no speed degradation.

Currently the shadow check is reversed, so it checks only that the shadow is not 0.
We need to implement sub-8-byte checking.

* Format

* Cleanup and formatting

* Sub-qword and 16-byte checks implemented; Fixed unaligned access to QWORD

* Pass the ucontext_t to signal handlers. Initial regdump on crash

* Fix typo

* Make the context argument a mut ref

* Add missing files; Implement initial reporting

* Refactor out gothook; Move safety checkers to dynasm

* Get rid of const assembly blobs no longer needed

* Move to a handler function instead of using SIGTRAP.

This bloats the transformed code, but doesn't seem to have a major impact on performance.

Also, implemented pretty backtraces and assembly output.

* Formatting

* Get rid of all the pinning crap I wasted my day on, We don't need it

* windows fixes

* ashmem

* ashmem_service: server side ready

* ashmem_service: client side ready. Ready for integration

* ashmem_service: changes to UnixShMem to make it 'threadable'

* ashmem_service: format

* ashmem_service: Undo changes to UnixShMem, make the thread own the AshmemService instead; Fix protocol bug

* ashmem_service: working ashmem service. Fix merge issues

* use the newly released capston e 0.8.0; Fix a nasty bug where the afl_area an pc_pointer were reversed. Changed Vectors to Boxed [u8]

* Implement type detection for reporting; Implement double-free/unallocated free checking

* fmt

* Cleanup code a little

* frida-asan: This is an omnibus commit. Should probably have been a bunch of small commits, but I don't have the time/patience.

 - Implemented DrCov support in order to debug a failing harness. This is actually
   generic and should be moved out of libafl_frida.
 - Implemented LIBAFL_FRIDA_OPTIONS env var to pass options to the frida helper,
   to dynamically enable/disable asan and drcov.
 - Implemented memory reuse - after each test case the used pages are recycled and
   can be reused in the next test case.
 - Implemented and tested vectorized instruction instrumentation.
 - Implemented not instrumenting atomic load/store instructions. The cost of
   trying to emulate their behaviour is too high at the moment.
 - Implemented probing of shadow bit to determine the best match for the current
   system.
 - Implemented shadow memory pre-mapping where it is available. We probe for this
   too.
 - Implemented ability to specify a list of modules to instrument on the command
   line. This allows fine-grained control of which modules are instrumented for
   coverage/asan/drcov.
 - Implemented unpoisoning of the Input target_bytes in a pre_exec hook.
 - Added support for zero-sized allocations. We return 0x10 bytes at the moment.
 - Added all known operator new/delete functions to hooks.
 - Added workaround for frida_gum_allocate_near bug.
 - Cleaned up reporting, added reporting for different error types.

* frida-asan: Implement leak detection

* Fix merge issues

* Rebased on dev to get llmp/shmem changes; Clippy fixes

* Add FridaOptions struct

* Add the Custom ExitKind; Get rid of Clone/PartialEq on ExitKind

* Make it possible to recover from an ASAN error

* Add SIGTRAP to crashing signals

* Add back (conditional) crashing on Asan errors.

* Fix too-large immediates in add instruction

* Implement RcShMemProvider, finally fix the EOP bug

* Clear ASAN_ERRORS before each test

* Fix warnings; Fix review issues

* Cleanup prints

* Add timeout to Frida mode

* Make allocation-/free-site backtraces optional

* CPU Context and backtrace (on android/aarch64 atm) on crash

* Make stalker conditional

* Add metadata to solution, and write metadata files

* Add addresses to backtrace; Add reporting of ASAN stack errors; Fix ASAN reporting bugs

* Remove meaningless backtrace on crash

* Fix the x0, x1 load in report

* use upstream color-backtrace

* use __builtin_thread_pointer instead of custom asm

* Don't unwrap ASAN_ERRORS if it isn't some

* Fix bug where we weren't clearing the drcov basicblocks after each run

* Fix bug where we were dropping an ashmem too soon

* Fix OwnedPtr instead of CPtr

* Fix gettls for all archs

* cfg guards for target arch, disabling Frida-ASAN/-DrCov if not on aarch64

* Cargo fmt

* Only panic in options when asan/drcov are turned on; Merge fixes

* gothook only supported on unix

* Fix gettls on msvc

* Another attempt to fix MSVC gettls

* Fix backtrace use

* nostd fixes; warning fixes

* formatting

* Migrate FridaEdgeCoverageHelper into libafl_frida, and rename to FridaInstrumentationHelper

* Clean up uses

* Move DrCovWriter to libafl_targets

* Refactor DrCovWriter to get a vec of DrCovBasicBlocks; formatting

* Update to newer backtrace which supports android with gimli

* windows fixes

Co-authored-by: Dominik Maier <domenukk@gmail.com>
Co-authored-by: andreafioraldi <andreafioraldi@gmail.com>
2021-04-28 10:12:49 +02:00
Dominik Maier
b8b01baf59 added warning for out of memory error aborts (addresses #32) 2021-04-26 19:07:22 +02:00
Dominik Maier
77867306f2 fixed code style 2021-04-26 19:01:24 +02:00
Dominik Maier
86f62ef560 updated todo 2021-04-26 16:23:51 +02:00
Andrea Fioraldi
32d4c27c83 cargo toml metadata 2021-04-26 14:28:48 +02:00
Andrea Fioraldi
a6774963ec readme 2021-04-26 13:56:18 +02:00
Andrea Fioraldi
744d2eaf7c docs 2021-04-26 13:44:45 +02:00
Andrea Fioraldi
3105972a65 IntoOwned for ownedref 2021-04-26 10:42:56 +02:00
Andrea Fioraldi
1829fcf191 refactor ownedref 2021-04-26 10:17:42 +02:00
Andrea Fioraldi
f25862cb90 fix baby fuzzer 2021-04-26 09:41:35 +02:00
Andrea Fioraldi
b7de33e922 feedbacks in libfuzzer_libmozjpeg 2021-04-25 16:13:15 +02:00
Andrea Fioraldi
7b54d725f3 reexport ctor in libafl 2021-04-25 12:48:02 +02:00
Andrea Fioraldi
964ce4f6eb const LEN for tuples 2021-04-24 10:47:37 +02:00
Andrea Fioraldi
ad5d45b3e2 fix 2021-04-23 17:34:11 +02:00
Andrea Fioraldi
15b7f0523c separate impl_serdeany macro for std and not 2021-04-23 17:32:25 +02:00
s1341
fc8056214b
Add selectable metadata format, including postcard and JSON (#59)
* Add selectable metadata format, including postcard and JSON

* Formatting

* nostd fix
2021-04-23 17:25:00 +02:00
Dominik Maier
c2efea2f93 cargo fmt 2021-04-23 05:46:58 +02:00
Dominik Maier
1a033406e7 more reworked docs 2021-04-23 05:45:46 +02:00
Dominik Maier
16f0e2cc05 reworked intro 2021-04-23 05:36:07 +02:00
s1341
91509c2346 Fix the impl_serdeany macro for use outside the libafl crate 2021-04-22 17:58:26 +03:00
Andrea Fioraldi
832c6ad1c6 save meta in ondisk corpus 2021-04-22 16:11:32 +02:00
Andrea Fioraldi
3124d03665 bytesinput to_file raw 2021-04-22 15:55:13 +02:00
Andrea Fioraldi
7b772fedc5 metadata to solutions 2021-04-22 15:44:41 +02:00