1314 Commits

Author SHA1 Message Date
Dongjia "toka" Zhang
888c608e5e
Revert "Fix pipe I/O in forkserver (#2602)" (#2612)
This reverts commit ea4a281d535cce1b522ed0fb328f02b016a4b4ea.
2024-10-14 14:17:40 +02:00
Henry Chu
ea4a281d53
Fix pipe I/O in forkserver (#2602)
* Fix read_st_size in forkserver

* fixed read_st, read_st_size, and write_ctl

with read_exact and write_all

* Cleanup redundant return values in forkserver pipe I/O

* Forkserver: avoid using read_exact/write_all for reading/writing integers

* Forkserver: avoid initializing the vec twice when reading a chunk of bytes

* Fix code formatting
2024-10-14 11:49:06 +02:00
Dominik Maier
cad9e2717e
Remove prelude from default features (#2608)
* Remove prelude from default features

* Prelude

* something
2024-10-12 13:16:22 +02:00
Dominik Maier
66a8682c9e
Add DrCov &.rerun options to QEMU_Launcher (#2607)
* Move all target-specific code to harness.rs

* Add IfModule to LibAFL_Qemu

* More more

* Added DrCov tracing

* Add DrCov rerun to launcher

* fixes
2024-10-11 16:02:01 +02:00
Dongjia "toka" Zhang
19ccb0807c
Don't do generalization on larger inptus (#2603) 2024-10-10 16:13:08 +02:00
Henry Chu
a69cd98432
Make ASAN log dumping optional (#2600) 2024-10-10 09:44:26 +02:00
Romain Malmain
c03653f7be
Remove useless allocation in colorization stage (#2598)
* do not allocate here

* clippy
2024-10-09 17:16:53 +02:00
cube0x8
1e4d38d744
Fix file sync timing and prevent crash on missing SyncFromDiskMetadata (#2595)
* max_time is the current_time(); SyncFromDiskMetadata might not be in state

* using metadata_or_insert_with
2024-10-09 17:16:32 +02:00
cube0x8
2b05e0a1fd
Do not start another logger in prometheus (#2599) 2024-10-09 17:15:56 +02:00
Dongjia "toka" Zhang
c12c6f31e2
Change fuzzbench_qemu fuzzer (#2520)
* change fuzzbench_qemu

* real test

* fix qemu crash hook

* update bindings

* fix fork executor, reduce trait bound overhead

* make EdgeModule depend on observer to get ptrs.

* do not make EdgeCoverageModule::new public

* map observer as builder call

* adapt examples with new edge coverage module builder.

* TMP: everyone is a variable length map observer

* reuse profile path script

* fix absolute paths

* remove some dependencies to make pipeline faster

* compile-time builder initialization check

---------

Co-authored-by: Romain Malmain <romain.malmain@pm.me>
2024-10-08 15:18:13 +02:00
Romain Malmain
1fbb18cb99
Versioning unification, dependencies update, logging optimization (#2560)
* versioning unification: use x.y.z format everywhere

* do not compile low-level logs (< info level) by default in fuzzers

* update dependencies to the latest versions

* add members to workspace.

* use workspace for common dependencies

* add vscode native support

---------

Co-authored-by: Toka <tokazerkje@outlook.com>
2024-10-07 12:03:29 +02:00
Dominik Maier
4fc136cd1c
Rand below should take a NonZero parameter (#2519)
* Rand below should take a NonZero parameter

* More

* more

* More

* fix build

* bit of clippy

* more clippy

* more clippy

* More clippy

* More more

* more nonzero

* fix multipart

* Cleanup, more unsafe

* fix

* fix unicode

* clippy, fmt

* more

* More safer and more better

* MaxStackPow

* fix merge fails

* make random_slize_size faster

* fix

* more

* fix
2024-10-04 02:16:10 +02:00
Romain Malmain
15157e0b72
Discard no tc mm (follow-up) (#2584)
* forgot to set the flags
2024-10-03 20:26:28 +02:00
Romain Malmain
9a50868058
Discard non-new testcase events for multi-machine messages (#2583)
* discard non-new testcase events

* clippy
2024-10-03 18:46:26 +02:00
Romain Malmain
9ceb9917a5
Do not embed client exec count in testcase and objective (#2582)
* do not include exec count in testcase

* remove exec count from objective as well

* fmt
2024-10-03 16:42:11 +02:00
Dongjia "toka" Zhang
cbce7ffdfd
No Uses* for Feedbacks (#2578)
* add from addison's change

* fixing

* one left

* adding

* 444444

* okoko

* no prelude

* i hate rust

* stuff

* no std/win

* getting closer

* a

* a

* aa

* a

* a

* libafl_fuzz

* toml

* tutorial

* libafl_libfuzzer
2024-10-02 14:07:08 +02:00
Dongjia "toka" Zhang
a212d66afe
No Uses* for Observers (#2568)
* first

* Round 2

* Round 3

* Round 4

* Round 5

* Round 6

* Round 7

* Round 8

* clp

* from windows

* roll back

* baby building

* doc

* no deref

* frida

* api

* a

* impl HasLen

* libafl-fuzz and fmt

* asan error

* Cargo toml

* who cares abotu freebsd seriously?????

* aaaa

* qemu stuf

* fixing what i can fix

* nyx

* more for qemu stuf

* fixup libfuzzer

* fix baby swap

* AsIterMut

* UsesObservers eliminated

---------

Co-authored-by: Your Name <you@example.com>
Co-authored-by: Addison Crump <addison.crump@cispa.de>
2024-10-01 17:51:09 +02:00
Romain Malmain
173aeddbcc
libafl multimachine: disable ratelimiting (#2558)
* disable rate limiting for now

* fix

* clippy

---------

Co-authored-by: Dongjia "toka" Zhang <tokazerkje@outlook.com>
2024-09-30 15:57:10 +02:00
Dominik Maier
82110472d6
Mark unsafe functions unsafe, as Ferris intended (#2559)
* Mark unsafe functions unsafe, as Ferris inteded

* More

* more safety?

* more fix

* actually safe

* More cleanup

* More fix

* more unsafe

* fix imports

* more unsafe

* fixes

* bring back the memories
2024-09-28 16:46:39 +02:00
Dongjia "toka" Zhang
23168af003
Delete redundant elapsed_since_signal from Batch timeout (#2567) 2024-09-27 14:36:44 +02:00
Dongjia "toka" Zhang
79b8390214
No Uses* for Corpus, Mutators (#2547)
* wip

* this shit is crazy

* from windows

* fmt

* fuck

* fmt

* aa

* reduce generics for generator

* do stuff for mutators, too

* aa

* a

* fmt

* idk

* getting things compiling

* fix merge

* idk

* fuzzers

* nire

* more

* a

* frida win

* cmin

* mm

* qemu?

* del ubuntu dep

---------

Co-authored-by: Your Name <you@example.com>
2024-09-26 20:03:03 +02:00
Romain Malmain
c944a70056
Linux kernel fuzzing example (#2496)
* linux kernel (x509_cert) and process fuzzing example

* rework filters

* update to latest qemu

* working for process and kernel fuzzing

* new i2s mutator for binary only fuzzers

* refactoring modules with new filtering interface

* add state as parameter of harness

* hide unused global in usermode

* Script for stub bindings generation

* do not try to check whether it is worth generating the bindings, always
  generate when the env variable is on.

* add taplo to fmt_all.sh

* Moved fuzzers (again) in a target-centric way.

* fix rust 2024 warnings.

* new libafl_qemu harness structure.

* rename qemu_systemmode into qemu_baremetal

* fix qemu baremetal makefile

* fix formatter

---------

Co-authored-by: Toka <tokazerkje@outlook.com>
2024-09-26 14:29:33 +02:00
Nils Bars
5ab7a07f14
Only track stability for runs that did not timeout (#2561) 2024-09-26 14:12:33 +02:00
Dan Blackwell
4e54182b35
Use const to Inform CmpLog Replacements (#2528)
* Add some knowledge of const parameters in cmplogs

* Careful with the CmpLog unions and clean macros

* Fix for macros?

---------

Co-authored-by: Dongjia "toka" Zhang <tokazerkje@outlook.com>
2024-09-24 17:16:07 +02:00
Dominik Maier
2bc211cc86
Make map size mismatch return a proper error instead of abort (#2553)
* Make map size mismatch return a proper error instead of abort

* More illegal state
2024-09-24 15:09:39 +02:00
Nils Bars
bacbffa6c1
Keep num_covered_map_indexes in sync with history map if block listing flaky entries (#2542) 2024-09-24 03:31:32 +02:00
Dominik Maier
f0d85aaaa5
No more (direct) mutable references to mutable statics (#2550)
* No more (direct) mutable references to mutable statics

* More

* Fix build, but it's unsafe dude

* more

* fmt

* More fix

* more?
2024-09-24 03:29:49 +02:00
Aarnav
7432bd0f59
libafl-fuzz: fix libafl-fuzz scheduler (#2545) 2024-09-23 18:56:09 +02:00
Aarnav
085db55f19
libafl-fuzz: fix not loading seeds recursively from directories (#2532)
* libafl-fuzz: fix not loading seeds recursively from directories

* add walk_initial_inputs to State

* libafl-fuzz: add afl++ style seed filename when copying initial files

* typo
2024-09-23 18:55:01 +02:00
Dongjia "toka" Zhang
cbfd194723
Reducing type parameters and bounds from Scheduler (#2544)
* actually reducing type parameters

* no std

* aa

* aa

* a
2024-09-23 17:01:21 +02:00
Dominik Maier
35779863c4
Bring back placeholder value in CommandExecutor to fix #2541 (#2543) 2024-09-23 15:59:06 +02:00
Dominik Maier
173a9ad8ea
Fix ForkserverExecutorBuilder::shmem_provider (#2539) (#2540)
* Fix ForkserverExecutorBuilder::shmem_provider (#2539)

* fmt
2024-09-23 14:15:11 +02:00
Dongjia "toka" Zhang
93fdbb604c
No Uses* (again) (#2537)
* ihatethislanguageihatethislanguageihatethislanguageihatethislanguage

* 1

* a

* fuck

* FMTFMTFMTFMTFMTFMT

* 👍

* afasdfadsfs

* lol

* aa

* a bit more
2024-09-23 14:03:24 +02:00
Valentin Huber
e370e2f852
Code Cleanup of #2422 (#2534)
* code cleanup

* removing another unnecessary borrow

* cleaning up the cleanup
2024-09-20 17:39:09 +02:00
Valentin Huber
2c676f0352
Add MappedInputs to allow havoc muations for custom (sub-)inputs (#2422)
* introducing MappingMutator

* extending mapping mutators

* adding example fuzzer

* making crossover mutators more flexible.

* moving example fuzzer

* fixing dependency paths

* formatting

* fixing no std error

* fixing broken docs link

* fixing import paths

* fixing imports

* more format fixing

* adding new example fuzzer to CI

* fixing further imports

* fixing formatting

* formatting fixes

* improving docs for the example fuzzer

* adding documentation and tests to mapping mutators

* make extraction function for mapped crossover mutators more general

* adding MutVecFunctionMappingMutator

* Introducing WrapsReference

* code cleanup for mapping mutators

* adding tests and docs to mapping mutators

* reformatting comments

* fixing merging of mutators in example fuzzer

* formatting

* formatting v2

* cleanup according to PR comments

* adding type constraint to MappedInput helper functions to remove the need to specify types

* matching functions passed to mapped_havoc_mutations

* removing unnecessary constraints

* mapping mutators now contain the name of their inner mutator

---------

Co-authored-by: Dominik Maier <domenukk@gmail.com>
2024-09-18 23:23:04 +02:00
Dongjia "toka" Zhang
5b7d307a6a
Add avoid_crash option to scheduler (#2530)
* chg

* add avoid_crash

* a

* clp

* just use .00 at this point

* libafl-fuzz chg
2024-09-18 17:57:40 +02:00
Dongjia "toka" Zhang
902571c0c7
Delete pruning.rs (#2533)
* set AFL_MAP_SIZE

* delete it
2024-09-18 17:35:31 +02:00
Dongjia "toka" Zhang
4e302a2115
Set AFL_MAP_SIZE in forkserver (#2531)
* set AFL_MAP_SIZE

* aaaaaaa
2024-09-18 17:03:48 +02:00
Marco C.
37f2d2dd0a
Move cfg to avoid unused import error (#2526) 2024-09-16 15:19:01 +02:00
20urc3
71ed5c7227
Update how exec/sec is displayed (#2524)
- Only display 1 digit after . for value above 1k
- Only display 2 digits after . for value above 1m

3.254k exec/sec becomes => 3.2k exec/sec
3.254M exec/sec becomes => 3.25M exec/sec
2024-09-13 21:03:18 +02:00
Dominik Maier
8ccff4b77f
Add StdState::nop() for simple state creation, make CI happy again on latest nightly. (#2521)
* Make CI happy again on latest nightly

* Fix build

* Unneeded comment

* fix tests

* clippy
2024-09-12 00:33:55 +02:00
Dominik Maier
25624d8eec
Rename HasCurrentStage to HasCurrentStageId for consistency (#2514) 2024-09-08 10:21:49 +02:00
ThomasTNO
70f1c13a4f
Remove redundant line (#2516)
* Remove redundant line

* No need to mut this value
2024-09-08 02:37:23 +02:00
ThomasTNO
a5584bf23a
Fix typo in error message (#2515) 2024-09-07 14:23:12 +02:00
Romain Malmain
203d3d340a
Multi machine follow-up (#2334)
* improved tree generator.
possibility to dump state on exit.

* warnings.

* clippy

* clippy

* aaaaaa

* aaaaaa

* make nix mandatory for unix

* stddddddd

* stddddddd

* stddddddd

* aaa

* clippy

* doc

* aaa

* aaa

* aaa

* aaa

* fix

* aaaaaaaa

* dump state

* aaa

* aaa

* aaa

* more minimal dump

* aaa

* aaa

* aaa

* simpler tc dump

* pub

* more pub

* revert a bit

* release by default

* delete Makefile.toml

* release

* dump execs

* merge

* delete stuff

* aa

* ff

* dig

* FMT cargo stuf

---------

Co-authored-by: Toka <tokazerkje@outlook.com>
2024-09-04 18:42:54 +02:00
Sharad Khanna
1113879a34
Fix i2srandreplace (#2504) 2024-08-30 14:15:26 +02:00
Sharad Khanna
a8bccf9f25
Minimizer fix (#2500)
* Clear potentially out of date id

* fmt

* add mut
2024-08-27 04:26:36 +02:00
Dominik Maier
e2cc78f274
Better documentation headers (clippy) (#2501)
* Better documentation headers (clippy)

* more doc

* more fixes

* Even more

* more

* even more

* concrete

* fmt

* even more more

* tiny typo

* more

* more

* More

* more

* more docs?

* more docs
2024-08-26 16:31:22 +02:00
9d83ddbd69 low prio warnings-- 2024-08-26 15:18:46 +02:00
f14d486ccf skip mutation of 0 size inputs 2024-08-26 15:10:12 +02:00