1232 Commits

Author SHA1 Message Date
s1341
652c24cb2a
windows: Support LIBAFL_DEBUG_OUTPUT (#1569) 2023-09-28 11:16:41 +03:00
Dongjia "toka" Zhang
dc7d561621
Don't send unstable entries if there's nothing (#1552)
* shutup calibration

* Update build_and_test.yml
2023-09-24 17:27:12 +02:00
Dominik Maier
f70a16a09a
Fix unsoundness for misaligned map observers (#1530)
* Fix unsoundness for misaligned map observers

* nits

* clippy

* Make sure beginning of the page is aligned
2023-09-20 18:25:37 +02:00
Addison Crump
761a77fce0
libafl_libfuzzer fixes for port and fd allocation (#1525)
* better port and fd handling

* fix multitude of CI failures
2023-09-20 17:36:43 +02:00
Benjamin Beyret
0e149afd7a
Allow both fuzz_time and iters in TuneableMutationalStage (#1531) 2023-09-20 12:47:56 +02:00
Dongjia "toka" Zhang
fdd2f53871
Fix doc in testcase_score.rs 2023-09-20 10:36:56 +02:00
Dominik Maier
3625e881a3
Fix forkserver child kill, add kill_signal support (#1521)
* Fix forkserver child kill, add kill_signal support

* more fix
2023-09-19 17:27:50 +02:00
Addison Crump
8f6efe993d
Address recent clippy changes; build clippy in debug instead of release for perf (#1516) 2023-09-19 00:42:46 +02:00
Addison Crump
6d0d4e287a
Metadata + infinite loop fix for TuneableMutationalStage (#1514)
* update tuneable: consistently access metadata + force 'choice'

* oops, loop in the wrong place

* clarify API some; allow for least of set configuration
2023-09-16 16:54:40 +02:00
Andrea Fioraldi
acecf46fb9
Ignore TCP recv if failed (#1519) 2023-09-15 13:18:46 +02:00
ToSeven
defe9084ae
Add an example fuzzer with AFL-Style UI (#1501)
* Add an example fuzzer with AFL-Style UI

* fix CI errors

* fix CI and improve the UI

---------

Co-authored-by: toseven <Byone.heng@gmail.com>
Co-authored-by: Dominik Maier <domenukk@gmail.com>
2023-09-12 10:17:31 +02:00
lenawanel
84beb61c3f
remove libafl/src/feedbacks/owned.rs (#1508)
fixes #1504
2023-09-08 11:14:37 +02:00
ToSeven
04aecd97f6
Add AFL-style metrics(pending,pend_fav, own_finds,imported) (#1351)
* add the metrics(pending,own_finds,imported)

* add the pend_fav metrics

* push

* Add the feature that AFLStats is computed and reported in AFLStatsStage

* fix some cicd errors

* AFLStats migrates to stage/stats.rs

* fix the cicd error

* fix some bugs and resolve the conflicts

* fix some typos

---------

Co-authored-by: toseven <Byone.heng@gmail.com>
Co-authored-by: toka <tokazerkje@outlook.com>
Co-authored-by: Dominik Maier <domenukk@gmail.com>
2023-09-06 03:38:41 +02:00
Dongjia "toka" Zhang
2076fc0722
Fix CI (#1498)
* Update build_and_test.yml

* Update build_and_test.yml

* fmt
2023-09-04 13:00:54 +02:00
ToSeven
a0bcdfa005
implement the AFL-Style Tui (#1432)
* implement an AFL-Style TUI

* improve the tui/mod.rs according to the reviews

* fixing fmt manually

---------

Co-authored-by: toseven <Byone.heng@gmail.com>
Co-authored-by: Dominik Maier <domenukk@gmail.com>
2023-09-03 23:52:48 +02:00
Dominik Maier
f27107c5e4
Fix docs build for libafl_qemu (#1495)
* Fix docs build for libafl_qemu

* turn around

* does this work?

* build all-features in CI

* fixes

* fix ci
2023-09-02 21:56:01 +02:00
Dominik Maier
134fe6a992
ForkserverExecutor: stop forked children on exit (#1493)
* wip

* Fix forkserver exit

* undo change in forkserver_simple

* less map_err

---------

Co-authored-by: Marco Vanotti <mvanotti@google.com>
2023-08-31 22:51:21 +02:00
Andrea Fioraldi
00033426e7
Bump to 0.11.1 (#1491) 2023-08-31 15:07:31 +02:00
Rowan Hart
bca14c041b
Update from unmaintained tui-rs to ratatui (#1488) 2023-08-31 02:02:36 +02:00
Dominik Maier
81bdbc0dde
Fix TuneableMutationalStage _std function generics (#1486) 2023-08-30 00:57:10 +02:00
Dominik Maier
5710c8b28a
Document LIBAFL_DEBUG_OUTPUT in Launcher (#1485)
* Document LIBAFL_DEBUG_OUTPUT in Launcher

* fmt

* more doc

* fork

* unix
2023-08-30 00:00:12 +02:00
Dominik Maier
61ad4a6ee8
bolts: Make xxh3 hashing optional with xxh3 feature flag (else use ahash for everything) (#1478)
* Make xxh3 hashing optional (and default to ahash)

* make xxh3 default anyway

* move import

* fix no_alloc

* No ahash without alloc

* fix import

* Keep xxh3 as default for libafl as well

* no randomness for xoshiro
2023-08-29 16:22:46 +02:00
Andrea Fioraldi
638d315b57
Add readmes (#1476)
* Add readmes

* fix docker
2023-08-29 14:51:55 +02:00
lenawanel
f3a4f4f664
Remove unneeded loop in SpliceMutator::mutate (#1471)
previously we searched for the first and the last difference
between exactly the same 2 inputs 3 times in a loop

Co-authored-by: Andrea Fioraldi <andreafioraldi@gmail.com>
2023-08-29 13:30:29 +02:00
Dominik Maier
7d2c854b71
Introduce document-features feature (#1477) 2023-08-29 12:40:35 +02:00
Andrea Fioraldi
062ae9d544
Fix doc for publish (#1472)
* Fix doc for publish

* add bolts to publish.sh
2023-08-28 17:22:44 +02:00
Andrea Fioraldi
7dd7c1a485
Bump to 0.11.0 (#1469)
Co-authored-by: Dominik Maier <domenukk@gmail.com>
2023-08-28 15:36:43 +02:00
Dominik Maier
b45985c76b
Less pub in LLMP (#1470)
* Less pub in LLMP

* add mut to docstring

* fix eample
2023-08-28 13:18:58 +02:00
lenawanel
6a2d6fa66d
fix some docs and use slice::fill instead of manual implementation (#1467)
* update documentation of `MinimizerScheduler`

(convert a few references to types into doc links and update the docs of `on_remove`)

* replace manual implementation of `slice::fill`

the in the code comment linked stackoverflow comment https://stackoverflow.com/a/51732799/1345238/
now mentions `slice::fill`
it seems to compile to the same thing as the old version https://rust.godbolt.org/z/98Y4x97vY

* fix docs for the `*InterestingMutator`s and `*ByteAddMutator`s

the macros didn't previously docs gens didn't previously
 generate fitting docs
2023-08-27 23:11:44 +02:00
Rowan Hart
8d8fcdd8db
Add generic cmp observer metadata, rename cmp observers, fix cmplogmap reset (#1461)
* Make cmp metadata generic, rename ForkserverCmpObservers with more accurate names

* Fix zeroed assignment in cmplogmap

* Dont use prelude in libafl_targets

* Make _mut functions actually return mut references

* Fix fuzzbench forkserver build

* Add type alias for easier construction of the standard cmp observer and add aux data accessors
2023-08-26 09:54:31 +02:00
Andrea Fioraldi
760edbf0d2
Fix forward_id stats for the centralized manager (#1454)
* Fix forward_id stats for the centralized manager

* Fix stats bug
2023-08-25 14:23:25 +02:00
Dominik Maier
f7c94f9a85
Create _std public methods on TunableMutationalStage (#1458)
* Create _std public methods on TunableMutationalStage

* No tunafish
2023-08-24 16:05:30 +02:00
Dominik Maier
9208531951
Move from intervalltree to meminterval dep (#1456)
* Move from intervalltree to meminterval dep

* fixes
2023-08-24 14:15:24 +02:00
Addison Crump
862de53cf6
Full libfuzzer shimming (for cargo-fuzz libfuzzer alternative and other use cases) (#981)
* squash libfuzzer edits

* fixup: compat with custom mutators

* use tui flag

* add introspection support

* use libfuzzer dep now that we've merged

* force input loading

* some fixes

* begin docs, impl shrink

* make whole-archive conditional and not default

* make more copies of counters maps

* lol, remember to add the observer

* make size edge map observer an observer

* fixup: make def of run driver conditional

* add sanity checks for insertion

* revert silencing of forks

* add experimental tmin support; add default asan flags

* use default options instead of specifying our own

* implement lockless mode

* fix merge

* fixup lockless corpus

* fixup for generalisation

* remove erroneous drop_in_place

* improve error logging in the case of corpus loading failure

* ok, use lock files 😔

* fix tmin

* implement merge (again); fix rare cases with maps being too small

* implement a scheduler for removing excess

* implement a walking strategy for corpus loading for large corpora

* revert filename parameter; rename and remove duplicates

* various cleanup and clippy satisfaction

* fix no_std tests

* clang-format

* expand and satisfy the clippy gods

* fix sanitizer_ifaces bindgen for no_std

* fix wasm fuzzer

* fixup clippy script

* rename and provide a small amount of explanation for sanitizer_interfaces

* fixup: HasLastReportTime

* fix clippy oddities

* restrict clippy checks to linux-only for libafl_libfuzzer_runtime

* name the mutators

* format

* fix clippy warning

* hope docker is fixed

* fix cmin lint

* clippy pass

* more docs

* more clippy

* fix remaining clippy complaints

* fix import

* miri fixes (no constructors executed)

* exclude libafl_libfuzzer from cargo-hack

* fix clippy check for sanitizer_interfaces

* fmt

* fix CI (?)

* deduplicate sancov 8bit for improved perf on ASAN

* merge 8bit coverage regions + comment out insane deduplication

* no erroring out on free hooks

* fixup for non-forking merge

* skip the corpus dir if we use it

* fixup: recent libafl changes and feature flags

* libafl_libfuzzer: use rust-lld for whole-archive feature

* clarify cause of failure

* mark unsafe

* clippy :cursed_cowboy:

* attempt to fix wasm

* spooky unknowable bug 👻

* more clippy lints

* clippy fix for merge

* use the version pin

* add unsafe to ::register

* Serdeany autoreg fix

* make type assert actionable

* miri fixes

---------

Co-authored-by: Dominik Maier <domenukk@gmail.com>
Co-authored-by: Dominik Maier <dmnk@google.com>
Co-authored-by: Mrmaxmeier <Mrmaxmeier@gmail.com>
2023-08-24 13:30:23 +02:00
Dominik Maier
f68fe95f09
Document features (#1453)
* Document features

* Fix doctest

* remove link

* <<<<head

* Fix doc links
2023-08-24 13:27:37 +02:00
Dominik Maier
e89e8dbaab
Remove dependencies, add doc.rs metadata (#1450)
* Remove dependency, add doc.rs metadata

* remove lazy_static

* even less lazy_static

* serial_test no default
2023-08-24 11:34:38 +02:00
lazymio
c84c105fb9
Allow setting max iterations for stages (#1436)
* Allow setting the max iterations

* Rename API

* Fix baby_fuzzer_grimoire

* Relax bound

* Also add a new API for transforming

* Revert back grimoire fix

* Revert bound relax
2023-08-24 09:59:11 +02:00
lazymio
20cee8cd33
Allow multiple tuneable mutational stages (#1437)
* Allow multiple tuneable mutational stages

* Fix for default name

* Fix import

* Format code

* Standalone trait bounds

* Minor fix

* Add _with_name API

* Format code

---------

Co-authored-by: Andrea Fioraldi <andreafioraldi@gmail.com>
2023-08-24 09:58:23 +02:00
Dominik Maier
2f840ef92d
Windows dependency upgrade (#1448)
* Windows dependency upgrade

* update windows

* fmt

* expect is not fun but what can you do

* fmt, clippy
2023-08-24 08:15:31 +02:00
Dominik Maier
454142c29e
Add bolts::math, make functions const, cleanup (#1444)
* Make some functions const

* fix isprint

* more const

* move integer_sqrt to bolts, use binary search, use u128 to handle extreme values

* Technically correct

* clippy

* u64 algo

* More test

* cumulative_distribution to in_place

* move calculate_cumulative_distribution_in_place to bolts

* clippy

* Move math stuff to bolts::math

* actually add math

* math?

* For some reason this fixes things, dunno

* fix builds?

* does that help?

* clippy ignores

* more clean clippy

* more cfg_attr
2023-08-23 21:12:39 +02:00
Manish Goregaokar
8f27b14eb8
Use postcard with default-features = false (#1446) 2023-08-23 19:53:25 +02:00
Rowan Hart
942c6a42ac
Reset headers with a memcpy, not an assign from zeroed (#1443) 2023-08-23 08:23:52 +02:00
Marco Vanotti
174b852e0a
Fix probabilities in TuneableScheduledMutator (#1440)
This commit fixes some issues regarding the `TuneableScheduledMutator`,
which had an edge case for drawing probabilities.

The user is supposed to provide a vector with probabilities that have to
add up to 1.0, but due to floating-point errors, the number can be
sligthly off.

If the sum ends up being slow, there's a chance that we draw a number
that is bigger than it (for example, 1.0), and that would not be present
in the cumulative distribution vectors (either for iterations or
mutations).

The issue is fixed by setting the last value of the cumulative
distribution to 1.0.

This commits adds some validations in the function that calculates the
cumulative distribution function, making sure that the numbers add up to
1, and that they are all between 0 and 1.

The API is now changed so the functions can now return an error instead
of crashing.

The commit also adds some tests, and fixes the `reset()` function.
2023-08-23 01:37:22 +02:00
Andrea Fioraldi
0b43711dc9
Fix LLMP p2p + restart bug with CentralizedEventManager (#1389)
This commit rewrites the centralized manager to use a secondary broker, as p2p communication is unreliable during frequent restarts. A centralized launcher is introduced too.
2023-08-22 15:57:50 +02:00
Rowan Hart
a14363f1fc
Make CmpValues Clone (#1439) 2023-08-21 22:11:11 +02:00
Dominik Maier
b0179b4498
Update some deps, clippy (#1422)
* More less default

* More clippy

* updated rangemap

* Clean up depencdencies

* Undo accidental remove

* Fix

* trying to fix qemu build

* hexagon be gone
2023-08-17 17:15:03 +02:00
lenawanel
5c05b3d32d
Update documentation of feedbacks::map::OneOrFilledIsNovel (#1423)
this previously seemed to describe `NextPow2IsNovel`
2023-08-15 20:14:30 +02:00
Dominik Maier
dcdfa978a4
Fix latest Clippy for good (#1418)
* More Clippy

* More clippy

* More ignore
2023-08-13 12:10:55 +02:00
Dominik Maier
e0d90aa67f
More Clippy fixes (#1415)
* More Clippy fixes

* Clippy
2023-08-13 01:17:34 +02:00
mark0
a55d40cd00
Update accounting.rs (#1411)
Remove dead code for better semantic compliance
2023-08-10 17:46:56 +02:00