1400 Commits

Author SHA1 Message Date
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
Dongjia "toka" Zhang
1172b5e5e0
Fix build and remove dump_state feature (#2513)
* fix

* remove dump_state
2024-09-06 14:22:33 +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
Romain Malmain
8d0ad23856
Check markdown links validity in CI (#2495)
* add markdown link check in ci

* fix broken links when possible.
configuration file for md checker.

* accept code 200...

* more fixes

* more fixes

* more fixes
2024-08-22 18:15:15 -05:00
Dongjia "toka" Zhang
f856092f3d
Fix libxml2 on fuzzbench (#2492)
* fix

* fmt

* fuck

* from windows

* fix

---------

Co-authored-by: Your Name <you@example.com>
2024-08-21 16:41:18 +02:00
Romain Malmain
4b87d7f4eb
Custom QEMU emulator typed builder + ExitHandler / Commands refactoring (#2486)
* Add a custom typed builder for Emulator

* Unify qemu_init for usermode and systemmode

* Remove env from qemu init args (it is unused in QEMU in practice)

* expose thread hooks to systemmode

* rename qemu_config to config

* Replace ExitHandler by EmulatorDriver

* Reorder generics alphabetically for Qemu{,Fork}Executor

* Moved snapshot manager to Emulator to continue centralizing mains objects in the same structure

* Reimplementation of CommandManager working with enums instead of tables

* Macro has been adapted to do this work automatically

* Moved snapshot stuff to dedicated module

* Removed many Rc<RefCell<...>>, now useless with the removal of vtables

* Builder given by Emulator via `Emulator::builder`. Reduced trait bound overhead
2024-08-21 16:36:45 +02:00
3b6cd3bc45 fix bug causing skipped mutation when part size is 0 2024-08-15 09:38:52 +02:00
Romain Malmain
13ba32ed2a
Unify qemu executor (#2483)
* Remove stateless qemu executor

* All harnesses take a reference to an emulator as parameter now

* harness takes an emulator as first parameter, and input as second parameter (opposite of previous definition)

* bump libafl qemu dependencies to the latest version
2024-08-13 19:44:10 +02:00
Aarnav
2287afc59b
libafl-fuzz: Introduce Support for QEMU mode (#2481)
* libafl-fuzz: simplify Makefile.toml

* Re-introduce support for old AFL++ forkserver

* clippy

* libafl-fuzz: add support for QEMU mode

* libafl-fuzz: simplify Makefile
2024-08-13 07:13:59 -05:00
Niklas Gögge
799c634fef
Implement FeedbackFactory for {Const,Not}Feedback (#2478)
* libafl: Impl FeedbackFactory for NotFeedback

* libafl: Impl FeedbackFactory for ConstFeedback
2024-08-09 12:24:46 +02:00
Max Ammann
3bebbe0dac
Update AsanBacktrace documentation (#2377)
* Add AsanBacktrace documentation

* Update stacktrace.rs
2024-08-05 22:10:46 +02:00
Dominik Maier
8fb80c3f3a
libafl_qemu: Continue build with outdated LLVM, ignore TUI race conditions (#2461)
* libafl_qemu: Continue build with outdated LLVM

* Ignore race condition

* ignore more race conditions, remove useless clones

* fix fixes
2024-07-30 14:48:17 +02:00
Romain Malmain
c319fe2033
Cheap reader for bytes slice (#2261)
* initial draft implementation

* change name to follow rust convention.

* revert use of HasTargetBytes instead of HasMutatorBytes for BytesSubInputMut

* clippy

* nostd

* clippy

* clippy

* * HasLen required if implementing HasTargetBytes.
* Added a checked version of the read to slice.

* clippy

* fix name.
better doc.

* added a common bytes trait for HasTargetBytes and HasMutatorBytes.

* change interface

* fix tests

* clippers

* use byte slice for subbytes

* adapt to main

* fix doc

* mut sub slice version. return subinput to old state, and add subslice stubs

* better api, doc fixes.

* Don't clone, reshuffle

* Move and rename

* Uh-oh

* move to bolts. rename things.

* nostd

* format

* alloc

* fix doc

---------

Co-authored-by: Dominik Maier <domenukk@gmail.com>
Co-authored-by: Dominik Maier <dmnk@google.com>
2024-07-30 13:46:40 +02:00
Dominik Maier
211809dddb
Cmplog bytes without alloc (#2442)
* Cmplog bytes without alloc

* fixes

* clippy

* remove wrong %
2024-07-30 13:42:48 +02:00
Dominik Maier
c4c0fb6750
Update pyo3 (#2459)
* Update pyo3

* Update pyo3 to 0.22

* Fix qemu python

* clippy

* fmt

* nautilus python

* More pyo3

* Make signature more legible
2024-07-29 22:55:28 +02:00
Dominik Maier
75af67f1e0
Fix CI after Rust 1.80, update to Ubuntu 24.04 (#2449)
* 0.13.2 (for real this time)

* More 0.13.2

* Make sure this never bites us

* Update ahash

* Fix CI after rust 1.80

* Does 18 work?

* Trying to fix this?

* lol regex

* noble

* works?

* fix llvm-config

* fmt

* Windows?

* more fix?

* more fix

* remove pip

* Add find_python3_version support to libafl_cc

* llvm-config

* more curl

* windows has no apt lol

* more
2024-07-29 15:31:41 +02:00
Mrmaxmeier
afbdc02c54
Format all tomls with taplo fmt (#2436)
Co-authored-by: Dominik Maier <domenukk@gmail.com>
2024-07-26 10:03:10 +02:00
Aarnav
76e1b4cb1e
Fix cmplog implementation (#2439)
* fix cmplog implementation
only set testcase filepath if filepath is none

* libafl-fuzz: fix minor CI

* add missing fields to AFLppCmpLogOperands

* libafl-fuzz: pin CI AFL version to a commit
fix extended_cmplog_instrumentation

* libafl-fuzz: fix CI

* this should not panic

* aaa

* libafl-fuzz: fix cmplog CI

---------

Co-authored-by: Toka <tokazerkje@outlook.com>
2024-07-25 18:10:21 +02:00
Dongjia "toka" Zhang
7391c6040b
always update textcase.file_path (#2432) 2024-07-23 15:02:03 +02:00
Dongjia "toka" Zhang
f6151f4507
0.13.2 (#2423)
* 0132

* fix
2024-07-19 23:00:37 +02:00
Dongjia "toka" Zhang
56d70accf5
Fix cmin (#2420)
* fix minimizer

* clp
2024-07-18 11:11:37 +02:00
Dongjia "toka" Zhang
4f970baa7b
Change Corpus Pruning algorithm (#2418)
* push

* upd

* add last found time

* add common as prerequisite

* clp

* aa

* more clp

* fix how to get corpus id

* pruning

* aa

* no std

* fix

* working?

* push
2024-07-18 11:11:14 +02:00
Dongjia "toka" Zhang
536f00a056
Don't panic even if bitmap is zero in calibrate.rs (#2419) 2024-07-17 18:26:17 +02:00
Romain Malmain
c96ea616fe
Qemu helpers & hooks refactoring (#2267)
* Helper is now called Module.

* Emulator now contains hooks state.

* Emulator is managed by QemuExecutor.

* QEMU hooks have been completely refactored on the rust side.

* Generics cleanup.
2024-07-17 11:46:42 +02:00
Dongjia "toka" Zhang
f00470ddaa
Corpus pruning stage (#2399)
* push

* upd

* add last found time

* add common as prerequisite

* clp

* aa

* more clp

* fix how to get corpus id

* pruning

* aa

* no std

* fix
2024-07-16 18:04:23 +02:00
__gsch
d8e53d5b65
impl HasEventManagerId for LlmpRestartingEventManager (#2406) 2024-07-16 14:06:56 +02:00
Aarnav
791598228e
fix incorrect interval check in sync from disk stage (#2408)
* fix incorrect interval check in sync from disk stage

* simplify check
2024-07-16 13:52:25 +02:00
Dominik Maier
4370a84bd2
Expose find_new_files_rec in libafl_bolts::fs (#2404) 2024-07-16 04:47:03 +02:00
Dominik Maier
dc93f6c186
Rename load_new_from_drectory to find_new_files_rec (#2403) 2024-07-16 03:35:36 +02:00
Dominik Maier
7850b9bce6
Address recursion Clippy in sync.rs (#2402) 2024-07-16 03:26:45 +02:00
Aarnav
aa21815a97
Introduce libafl-fuzz (#2362)
* Introduce libafl-fuzz

* fix corpus file path

* simplify SeedFeedback

* fix incorrect comment

* add clap::ValueEnum to PowerSchedule as an optional derive if clap is enabled

* UnixShMemProvider replaced with StdShMemProvider for libafl-fuzz

* remove io_error_more feature constraint

* libafl-fuzz: make Ok(()) unreachable in CentralizedLauncher

* libafl-fuzz: make harness_input_stdin to harness_input_type with &'static

* libafl-fuzz: move each feedback to it's own file

* make run_fuzzer_with_stage into a function.
use CachedOnDiskCorpus instead of OnDiskCorpus for Corpora
remove utils file

* remove unecessary clone

* libafl-fuzz: cleanup AFLStatsStage

* move peak_rss_mb to libafl_bolts

* parse envs by hand

* add sensible defaults for map size and broker port

* fix test.sh and corpus_id padding

* add Makefile.toml

* libafl-fuzz update test suite

* libafl-fuzz: clippy

* rename peak_rss_mb to peak_rss_mb_children

* remove minor version constraint for clap

* libafl-fuzz: fix ELF check and instrumentation check in check_binary

* libafl-fuzz: improve Makefile.toml

* simplify fuzzer and cleanup typos

* libafl-fuzz: load corpus entries in a multicore fashion

* libafl-fuzz: create output dir if not exists (non-racey)

* libafl-fuzz: add sequential scheduling support
libafl-fuzz: add cmplog options
libafl-fuzz: add test-cmplog.c to CI

* rename peak_rss_mb_children to peak_rss_mb_child_processes

* fix race condition in SyncFromDiskStage, add interval based checking and support for multiple directories.
libafl-fuzz: add support for syncing with foreign fuzzers

* update README

* implement AflScheduler for QueueScheduler.
Add queue_cycles field to
AflScheduler

* libafl-fuzz: remove dependecy on SchedulerMetadata for AflStatsStage

* clippy

* remove queue_cycles from AflScheduler into int's own trait.
libafl-fuzz: simplify map observer tracking

* clippy

* libafl-fuzz: disable cmplog check in CI for now

* add missing constraints for libafl_qemu executor

* clippy

* libafl-fuzz: improve Makefile
libafl-fuzz: clippy

* libafl-fuzz: misc

* misc typos, beautify

---------

Co-authored-by: Dongjia "toka" Zhang <tokazerkje@outlook.com>
Co-authored-by: Dominik Maier <domenukk@gmail.com>
2024-07-16 02:10:20 +02:00
Dominik Maier
9d5be4ede1
clippy_nyx (#2401) 2024-07-15 23:49:56 +02:00
Aarnav
fed61eb6b8
Fix qemu_launcher by moving stop request handling to fuzz_one (#2394)
Co-authored-by: Romain Malmain <romain.malmain@pm.me>
2024-07-15 15:41:51 +02:00
Dominik Maier
ea3e70b6e5
Remove release_max_level_info from log (#2396) 2024-07-15 14:55:13 +02:00