3586 Commits

Author SHA1 Message Date
Dongjia "toka" Zhang
2afa947652
Fix CI (#2865)
* chg

* ci
2025-01-18 16:36:20 +01:00
Dongjia "toka" Zhang
da854587d7
Set rust-analyzer.cargo.allTargets to False in setings.json.default (#2864) 2025-01-18 13:32:57 +01:00
Konstantin Bücheler
faeed19c43
Add NyxCmpObserver and nyx_launcher example fuzzer (#2826)
* Add NyxCmpObserver to libafl_nyx

* Add nyx_launcher example fuzzer

* Cargo Format/Clippy

* Adapt to naming scheme

* Taplo fmt

* Add hex decode function to remove hex dependency

* Add nyx_launcher to CI

* Remove UsesState

---------

Co-authored-by: Dominik Maier <domenukk@gmail.com>
2025-01-18 13:21:04 +01:00
Dongjia "toka" Zhang
2e26af90db
Better error message in testcase_score.rs pt.2 (#2863)
* msg

* l
2025-01-18 13:07:14 +01:00
Dongjia "toka" Zhang
019c71a368
Better error for missing TopRatedsMetadata (#2860) 2025-01-17 21:42:51 +01:00
Romain Malmain
f8ad61e14a
Remove Input associated type (#2854)
* Completely remove Input as an associated type in multiple traits

* Unify usage of Input as generic instead 

* Remove many unused bounds, in particular HasCorpus

* fix multiple generic ordering

* update and fix CONTRIBUTING.md

* update MIGRATION

* use the same generic input type for new / with_max_iterations to make typing easier in most cases.

* Restore libafl_libfuzzer test in CI
2025-01-17 14:53:51 +01:00
h1k0
d4add04f87
Add comments for EmulatorModule trait (#2842)
* Add comments for EmulatorModule trait

---------

Co-authored-by: h1k0 <h1k0naka@outlook.com>
Co-authored-by: Dongjia "toka" Zhang <tokazerkje@outlook.com>
2025-01-16 17:49:22 +01:00
Valentin Huber
93c5adde4d
Remove MapObserver dependency from observer-dependent stages and schedulers in favour of generic hashing (#2851)
* Introdue SimpleHash separate from MapObserver

* Move to Hash for hashing

* Fix docs, remove even more restrictions

* fix libafl_targets

* fix fuzzer

* Remove broken and unnecessary derive

* Remove unnecessary trait restriction

* Remove unnecessary import

* Add changes to MIGRATION.md

* Remove more unnecessary imports
2025-01-16 16:34:58 +00:00
Railroad6230
15aa498d5e
Fix #2853: split HasMutatorBytes trait into two traits. (#2856)
(See #2853.)

This commit attempts to improve the [`HasMutatorBytes`] trait to allow it to
be used along with input types that cannot be resizable.

[`HasMutatorBytes`] is split into two traits:

 - [`HasMutatorBytes`]: requires `bytes` and `bytes_mut`.
 - `HasMutatorResizableBytes`: requires [`HasMutatorBytes`], and also requires
   a few other methods for resizing / shrinking the underlying input type.


N.B.: I believe that if merged, this would introduce a breaking change.

[`HasMutatorBytes`]: 198cd5dbc5/libafl/src/inputs/bytes.rs (L26)
2025-01-16 17:06:19 +01:00
Valentin Huber
198cd5dbc5
Fix formatting in MIGARTION.md (#2855) 2025-01-16 14:16:47 +01:00
bernhl
c9531aa242
Remove unecessary HasTargetBytes constraint (#2852) 2025-01-16 10:51:18 +01:00
Dongjia "toka" Zhang
cfe051e5d9
Remove UsesState from libafl-fuzz (#2849) 2025-01-15 20:18:24 +01:00
Dongjia "toka" Zhang
9fd5af76c3
Highlight contributing.md (#2850) 2025-01-15 19:08:30 +01:00
Dongjia "toka" Zhang
435ca021cc
No uses for EventManager (#2831)
* the first step of the last step

* wip

* 99% done

* 99.9% done

* 99.99

* Hello from windows

* aaa

* 99.999

* aa

* 1

* 2

* 3

* 4

* 5

* plz

* plzplzplz

---------

Co-authored-by: Your Name <you@example.com>
2025-01-15 16:56:40 +01:00
Valentin Huber
ba09cb0706
Add OnDiskJsonAggregateMonitor (#2845)
* Add OnDiskJsonAggregateMonitor

* Fix formatting

* Remove unnecessary trait bounds

* Remove unnecessary import restriction

* Remove unnecessary imports

* fix formatting
2025-01-15 13:40:26 +01:00
Dongjia "toka" Zhang
dc39aadb05
Revert "Don't fail fast for now" (#2844)
* Revert "Don't fail fast for now (#2843)"

This reverts commit 332ddf46554336eeb538a42accbc7c0a11b03f0f.

* aa
2025-01-15 11:26:41 +01:00
Dongjia "toka" Zhang
332ddf4655
Don't fail fast for now (#2843) 2025-01-15 10:40:40 +01:00
Sharad Khanna
00c6970d24
Fix libafl_targets cmplog linking (#2840) 2025-01-14 21:04:44 +01:00
Dongjia "toka" Zhang
cd19a72d03
Put debugging.md for better visibility (#2839) 2025-01-14 17:37:55 +00:00
jejuisland87654
a844e5e07d
Remove unecessary default features for sub crates using LibAFL (#2836)
* remove unecessary default features

* fix format
2025-01-14 16:11:43 +00:00
Romain Malmain
a45e44764f
Remove UsesInput from libafl qemu (#2832)
* remove UsesInput from libafl_qemu

* Insert I bound instead of ugly Corpus::Input stuff

* Uses a C generic for Commands

* adapt nyx api to new generics

* add qemu linux fuzzers to CI for building.
2025-01-14 10:24:28 +01:00
s1341
8adb2aa7b5
libafl_ar: fix error message (#2833) 2025-01-14 10:34:52 +02:00
Romain Malmain
d8460d14a2
More Nyx hypercalls supported in libafl qemu. add tests for filters. (#2825)
* more nyx hypercalls implemented, among them:
- panic hypercall
- range filtering hypercall

* fixed some nyx hypercalls behavior.

* added generic read / write to qemu memory

* port linux kernel example to also have nyx API, add better filtering as well.

* make nyx api structs volatile to avoid optimization issues

* Introduce a method create a Vec in place, using a closure.

* use new vec_init function in relevant places.

* removed unused unsafe keywork

* add more allocated memory r/w callbacks

* add more safety notes

* move emulator hooks to separate struct

* update QEMU version
2025-01-13 17:32:23 +01:00
Dominik Maier
02566b33cd
Make Stats stage send stats again (#2830)
* Make Stats stage send stats again

* re-remove stats mod

* clp, fmt

* clip
2025-01-13 15:06:26 +00:00
Dongjia "toka" Zhang
fd06e5ced0
Remove CustomBufHandlers (#2829)
* rem

* fix

* fixer
2025-01-13 16:00:41 +01:00
Dongjia "toka" Zhang
aa0391ef8d
No Uses* from executor (#2766)
* first step

* wip

* lol

* making progress, slowly

* add

* a bit more

* progress

* 80%done

* 90% done

* done from linux

* Hello from windows

* 1

* 2

* 3

* 4

* 5

* 6

* 7

* Hello from windows

* 9

* 10

* 11

* 11

* 12

* 13

* aa

* fixer

* a

* oops

---------

Co-authored-by: Your Name <you@example.com>
2025-01-11 15:25:15 +01:00
Marco C.
ca647f0c30
CI check-md-links fix (#2824)
Use ubuntu-22.04 and restore the action instead of the script
2025-01-09 12:04:01 +01:00
cube0x8
1a9e25145d
Fix snapshot reset function when brk shrunk below the snapshotted value (#2812)
* added change_brk function for correctly handling SYS_brk

* we need to update h.brk with the new brk_val

* map back pages if brk shrunk below the snapshotted value

* fmt and clippy

* use GuestAddr instead of u64

---------

Co-authored-by: Romain Malmain <romain.malmain@pm.me>
2025-01-09 00:30:39 +01:00
Dominik Maier
f7745155c9
Upgrade all Windows crates (#2823)
* Upgrade all win crates

* wtf

* fix
2025-01-09 00:25:33 +01:00
dependabot[bot]
fbd76721a1
Update prometheus-client requirement from 0.22.3 to 0.23.0 (#2819)
Updates the requirements on [prometheus-client](https://github.com/prometheus/client_rust) to permit the latest version.
- [Release notes](https://github.com/prometheus/client_rust/releases)
- [Changelog](https://github.com/prometheus/client_rust/blob/master/CHANGELOG.md)
- [Commits](https://github.com/prometheus/client_rust/compare/v0.22.3...v0.23.0)

---
updated-dependencies:
- dependency-name: prometheus-client
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-08 13:42:46 +01:00
dependabot[bot]
e44c23b71c
Update windows-result requirement from 0.2.0 to 0.3.0 (#2822)
---
updated-dependencies:
- dependency-name: windows-result
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-08 13:42:25 +01:00
Valentin Huber
9b8b552f27
Make more int mutator types public (#2821) 2025-01-07 17:02:13 +01:00
Dominik Maier
719a3c0f07
Continue loading inputs even if some fail to deserialize (#2820)
* Continue loading inputs even if some fail to deserialize

* fmt

* fix
2025-01-07 15:07:46 +01:00
Romain Malmain
9f8f47233c
Add migration notes for libafl qemu's Emulator configuration changes (#2818)
* add migration notes for libafl qemu latest changes
2025-01-06 17:34:45 +01:00
Romain Malmain
17336dcf57
Nyx hypercall API support for LibAFL QEMU (#2801)
* Nyx hypercall API support

* fix linux kernel fuzzer

* hash_me -> hash_64_fast

* fix multiple bug in kernel harness

* do not check libmozjpeg's C files format.
2025-01-06 16:58:57 +01:00
cc2a2e6422 fix edge fuzzing 2025-01-06 15:52:48 +01:00
Romain Malmain
7c8708d4b1
Refactor of Qemu configuration (#2707)
* Qemu config refactoring.

* QEMU error refactoring.

* Single QEMU init function.

* Light refactor of EmulatorModules.

* Qemu is now a parameter to EmulatorModule callbacks and most function hooks.

* EmulatorModules is initialized before QEMU is initialized.

* refactor asan and asanguest modules to avoid custom init of QEMU and use the module interface instead.

* asan fixed size accesses working with generics.

* use pre_syscall_* and post_syscall_* everywhere for consistency.

* adapt qemu_launcher example to fully work with Emulator, since Qemu must now be initialized by Emulator.

* start writing Emulator / EmulatorBuilder / QemuConfig doc.

* fix broken intel pt doc.
2025-01-06 15:04:40 +01:00
WorksButNotTested
5a3cbc18a7
Changes to use InMemoryCorpus (#2816)
Co-authored-by: Your Name <you@example.com>
2025-01-06 11:22:08 +01:00
Dominik Maier
742773bc17
Add BoolValueFeedback (#2815)
* Add BoolValueFeedback

* No_std

* clippy

* Fix tests

* More clip

* fix no_std tests
2025-01-06 04:25:36 +01:00
Dominik Maier
4b4a22bc44
Cargo Format (#2814)
* Initial commit: ValueBloomFeedback

* Add test, fix feedback

* Remove unneeded feedback

* fix

* more commit

* Cargo fmt

* fmt
2025-01-06 02:11:47 +01:00
Dominik Maier
2a3f5a5942
Add Bloomfilter-based Feedback for Values (#2813)
* Initial commit: ValueBloomFeedback

* Add test, fix feedback

* Remove unneeded feedback

* fix

* more commit
2025-01-06 02:03:18 +01:00
Dominik Maier
6e921cf870
More clippy (#2811)
* More clippy

* clip
2025-01-05 15:56:27 +01:00
Dominik Maier
b3b216386e
Another clippy bugfix (#2806) 2025-01-03 16:05:02 +01:00
WorksButNotTested
da55e70aa3
qemu_launcher: Fix command line parsing of ranges (#2804)
Co-authored-by: Your Name <you@example.com>
Co-authored-by: Dominik Maier <domenukk@gmail.com>
2025-01-03 16:04:41 +01:00
Dominik Maier
d39ded5b29
Fix and/or mute more clippy lints, deprecation warnings in Pyo3 (#2805) 2025-01-03 15:17:46 +01:00
jejuisland87654
7543a54d0d
Add dynamic frida runtime list called FridaRuntimeVec (#2799)
Co-authored-by: Dominik Maier <domenukk@gmail.com>
2025-01-02 16:33:47 +01:00
henri2h
187e06cb11
Specify that InProcessForkExecutor should abort on panic (#2803)
* Revert "New year new clippy (#2797)"

This reverts commit deb76555b75ca2ccac83b83a6db1a276c07080b5.

* Mention that program should panic when using InProcessForkExecutor

* Reapply "New year new clippy (#2797)"

This reverts commit 529213ef6334fc18e1898f3cfbd8bed24c312522.
2025-01-02 23:57:57 +09:00
Dominik Maier
deb76555b7
New year new clippy (#2797)
* New year new clippy

* More clipy

* fix
2025-01-01 20:57:43 +01:00
AshrafIbrahim03
92db678995
Added expect error message to TimeFeedback where there used to be an unwrap (#2777)
* Added expect error message to TimeFeedback where there used to be an unwrap

* Changed error message handling

* fixed cargo clippy

---------

Co-authored-by: Dominik Maier <domenukk@gmail.com>
2024-12-30 20:47:04 +01:00
Mehtab Zafar
8cd069cf3e
Optimize event serialization with pre-allocated buffer (#2794)
* Optimize event serialization with pre-allocated buffer

- Added event_buffer field to LlmpEventManager
- Used to_slice instead of to_allocvec
- Pre-allocated buffer size is 4KB

Fixes #1082

* Fallback to to_allocvec in case of event_buffer overflow

Also combined the shared logic between compressed & uncompressed event
firing while keeping the same behavior

* Made the initial event_buffer size to a const

Also removed the unnecessary event_buffer.clear(), since we are already
resizing it
2024-12-30 20:45:48 +01:00