3198 Commits

Author SHA1 Message Date
894c11935f display stats 2024-10-30 15:27:48 +01:00
7c71e683d8 don't remove all items from corpus 2024-10-30 14:45:32 +01:00
Romain Malmain
9da113e7a8
Fix RISC-V port issues (#2642)
fix riscv{32,64} stuff
2024-10-30 14:10:50 +01:00
s1341
af06d75d3e
frida: bump version (#2640)
* frida: bump version

* frida_windows: fix
2024-10-30 12:31:40 +01:00
saibotk
83c87acd5b
libafl_qemu: Add RISCV support (#2367)
* libafl_qemu: Add RISCV support

Adds the following targets (as features):
- riscv32
- riscv64

Added `RISCVCPU` and `CPURISCVState` to the bindings allow list.

Added riscv.rs to the arch module, with all necessary functions and
registers implemented and mapped.
The registers are the same as the ones found in qemus gdbstub xml found
after a build.

Additionally we added all syscall numbers for riscv 64 bit (already
supported by the `syscall_numbers` crate) and also added the missing
ones for riscv 32 bit. We compared both lists and their differences /
equalities with a simple python script and generated a list of the
missing ones, to be complete.
We might PR those to the `syscall_numbers` crate later on.

---------

Co-authored-by: Romain Malmain <romain.malmain@pm.me>
2024-10-30 10:33:03 +01:00
Dominik Maier
6eb2dafd34
Feature: Make executors and feedbacks easier to use outside of the fuzzing loop (extends #2511) (#2637)
* feat(libafl_core): make executors and feedbacks more cleanly usable outside of LibAFLs Fuzzer loop

* cargo +nightly fmt

* updated type constraints

* reformatted and final type constraint fixes

* made unicode extraction stage useful separately

* fix libafl_cc error message

* fix state type constraint to be constrained on the method

* removed unnecessary observer constraint

* renamed unused variables

* fix unnecessary error wrapping in helper functions

* converted unicode conversion stage into associated function and fixed nautilus changes

* more update

* Remove extra I

* more fmt

* bounds?

* less bounds

* more less bounds

* different trait bounds again

* more less generics

* fix unicode

* fix list

* remove unneeded bound

---------

Co-authored-by: Lukas Dresel <Lukas-Dresel@users.noreply.github.com>
Co-authored-by: Toka <tokazerkje@outlook.com>
2024-10-29 18:35:17 +01:00
0e7de2d109 imports eval-24-10-30 2024-10-29 18:23:02 +01:00
f1affaabff impl RemovableScheduler for GenerationScheduler 2024-10-29 18:21:46 +01:00
0a6888d06a add pruning message 2024-10-29 18:10:16 +01:00
d88cefb894 add experimental corpus pruning 2024-10-29 18:08:18 +01:00
4d0ec2e427 typo 2024-10-29 16:01:25 +01:00
a613156a32 micro fixes 2024-10-29 15:59:15 +01:00
013f3db487 implement STGSnippetStage, fix missing metadata 2024-10-29 14:07:52 +01:00
Aarnav
0f744a3abb
Add Python Grammar Loader for Nautilus (#2635)
* add python grammar loader for Nautilus

* fmt

* fmt toml

* add python to macos CI deps

* install python

* fmt

* ci

* clippy

* fix workflow

* fmt

* fix baby nautilus

* fix nautilus sync

* fmt

* fmt

* clippy

* typo

* fix miri

* remove pyo3 from workspace to packages which need it and make it optional

* go back to AsRef<Path> for nautilus grammar loading

* replace hardcoded python flags for macos build

* typo

* taplo fmt

* revert formatting of libafl_qemu_arch

* ci

* typo

* remove expects in NautilusContext::from_file and make them Results

* remove not(miri) clause in test

* try and fix python build fir ios and android

* again

* android

* tmate

* fix android build

* document load_python_grammar

* log if python or json when loading nautilus grammar

* make nautilus optional

* add nautilus as feature to forkserver_simple_nautilus
2024-10-29 11:32:59 +01:00
Aarnav
58fad2befd
libafl-fuzz: separate frida build + cmplog debug (#2591)
* libafl-fuzz: separate frida build

* cmplog debug

* update

* merge AflStatsStage
move time_tracker stage to LibAFL

* mandate track_hit_feedbacks feature for AflStatsStage

* afl_stats do not hardcode TimeoutFeedback and CrashFeedback names

* typo

* typo

* fix generics order

* add verify timeouts stage

* libafl: introduce set_timeout func to dynamically set timeouts for executor
libafl-fuzz: add verify_timeout stage

* add missing set_timeout implementations

* libafl-fuzz: move set_timeout and timeout from Executor to HasTimeout

* libafl-fuzz: add removed gitignore

* remove timeout from libafl_nyx::Executor and move it to NyxHelper

* clippy

* fix HasTimeout for QemuExecutor

* libafl-fuzz: remove observer handle usage in verify_timeouts
misc: remove prelude imports

* libafl-fuzz: fix foreign_sync_dirs option

* fmt && clippy

* clippy && fmt

* missing doc

* clippy

* bruh

* damned doc build

* trait fix

* impl HasTimeout for InProcessExecutor only if std

* clippy

* fix typo

* fix nostd build

* clippy

* remove most HasTimeout implementations for now

* typo

* remove redundant import

* misc

* fmt

* simplify trait bounds

* add old AflStatsStage back and rename it to StatsStage

* fix ci

* make set_timeout and timeout of HasTimeout inline

* fmt

* add gitignore

* serde_any fix

* tmate

* misc

* remove tmate

* test

* coordinate between capture_timeout and verify_timeout

* makefile

* fix

* fix

* fmt

* increase cmplog timeout

* semantic

* debug

* debug

* remove dbeug

* only test libafl-fuzz on CI for now

* better seed for cmplog?

* remove preflight check for now

* set Input type in forkserver

* debug

* tmate

* fix capture_timeout

* revert workflow

* run only libafl-fuzz

* remove pre-flight

* re-enable fuzzers on CI

* move capture_timeouts and verify_timeouts to main lib

* run fmt

* add note for verify timeouts

* add note in verify timeouts stage

* typo

---------

Co-authored-by: Dominik Maier <domenukk@gmail.com>
2024-10-28 11:40:04 +01:00
3d0c0247b7 trace mem bytes read 2024-10-28 08:12:30 +01:00
d89d5e3e5e introduce JobInstance, TaskJob 2024-10-28 08:10:45 +01:00
Dominik Maier
42b306a39f
Fix LibAFL-fuzz build (#2634) 2024-10-26 02:03:22 +02:00
WorksButNotTested
03af6aaf0c
Frida scripting support (#2506)
Co-authored-by: Your Name <you@example.com>
2024-10-25 17:18:25 +02:00
Marco C.
053d125254
fix clippy redundant field names in struct initialization (#2633) 2024-10-25 16:07:34 +02:00
Marco C.
b9e6363826
Avoid using feature flags and env variable to set the same parameter pt.1 emulation_mode (#2512)
* Remove emulation_mode env variable and custom cfg

* Using only the feature flag simplifies things a bit and allow the usage of optional dependencies

* Do not use --all-features on libafl_qemu

* Add missing target_os = "linux"
2024-10-25 15:16:55 +02:00
Dominik Maier
e27ec269ce
Add TargetBytesConverter to allow Nautilus for ForkserverExecutor (#2630)
* Add TargetBytesConverter to allow Nautilus for ForkserverExecutor

* ci

* ci

* More

* fmt
2024-10-24 14:10:26 +02:00
Reverier Xu
261b6b5a52
minor: fix mutable reference warning in examples (#2631) 2024-10-24 12:25:39 +02:00
Langston Barrett
dfd5609c10
bolts: Simplify definition of nonzero! macro (#2624)
* bolts: Simplify definition of `nonzero!` macro

* Non-Usize NonZero

---------

Co-authored-by: Dominik Maier <domenukk@gmail.com>
2024-10-24 00:28:47 +02:00
d8a15adb1d move codepieces 2024-10-22 14:25:51 +02:00
c5c9a052e4 remove interval_name from interval, fix snakefile showmap 2024-10-22 09:05:21 +02:00
Romain Malmain
d96d833760
Support on_crash & on_timeout callbacks for libafl_qemu modules (#2620)
* support (unsafe) on_crash / on_timeout callbacks for modules

* use libc types in bindgen
2024-10-21 17:59:04 +02:00
f9f59211fb do not use error as objective for showmap 2024-10-21 17:29:56 +02:00
a7f24da786 show function ranges 2024-10-21 17:14:14 +02:00
8417613cb2 save stats per abb 2024-10-21 17:13:38 +02:00
Dongjia "toka" Zhang
f0da4d15da
Fix Generator (#2627)
* no min but max

* import

* large stack arrays ?
2024-10-21 16:27:25 +02:00
Dongjia "toka" Zhang
fda1596ee2
Use nonzero! macro (#2589)
* nonzero_lit

* nonzero

* std instead of core

* a

* l

* test

* import

* api

* api

* aaaaa

* apiapi

* api

* api

* api

* mm

* api

* non zero

* FMT

* pls

* nnnaaasdfadsfafdsa

* pls

* MM

* fix

* a

* sat add

* aa

* mistake

* unreachable

* no generic

* api change

* a
2024-10-18 23:33:03 +02:00
926ad96b8e print hash on graph nodes 2024-10-18 15:04:47 +02:00
d4e6de3e80 shrink moving average window size to ~5 min 2024-10-18 13:18:44 +02:00
735fc3e144 collect first n error inputs as objectives, fix configs 2024-10-18 13:08:13 +02:00
bf827c077f use moving average success rate for interrupt mutation frequency 2024-10-18 11:09:44 +02:00
Romain Malmain
3b31b4d796
libafl_qemu: unset thumb bit for breakpoints (#2619)
* unset thumb bit for breakpoints
2024-10-17 09:42:56 +02:00
Romain Malmain
23e966c702
Fix CI apt-get install (#2618) 2024-10-16 13:17:34 +02:00
Romain Malmain
31e31b662d
Adapt qemu linux fuzzers to latest LibAFL version (#2616) 2024-10-16 10:41:37 +02:00
3a126cb0a8 target_symbols.csv++ 2024-10-15 17:02:08 +02:00
Dominik Maier
4710915b61
Revert "Revert "Fix pipe I/O in forkserver"" (#2614)
* Revert "Revert "Fix pipe I/O in forkserver (#2602)" (#2612)"

This reverts commit 888c608e5e56e2df55271dab262bb0eac400a416.

* More expressive errors

* fix testcase
2024-10-15 16:31:25 +02:00
875f87f0c6 fix detection of releases by api call 2024-10-15 16:22:42 +02:00
Romain Malmain
d48a7d508d
Centralize clippy lints in workspace (#2606)
* centralize clippy definition

* fmt

* add update bindings script

* add a checked and unchecked version of memory read to qemu stuff

also, a lot of clippy thing

* update binding position

* rm old script, new one is a bit better

* update doc

* macos clippy

* adapt fuzzers

* windows clippy

* fix fuzzer

* windows clippy

* remove old allowed clippy

* remove some allowed clippy

* use default features for serde_json in gramatron

* better error handler for failed rw to memory
2024-10-15 13:31:01 +02:00
Dongjia "toka" Zhang
453d733a35
Use .vscode/settings.json.default (#2615)
* .gitignore .vscode

* vscode

* vscode

* ignore
2024-10-14 15:45:17 +02:00
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
da8f17f29e
Add AFLStats to QEMU_Launcher TUI (#2611)
* Remove prelude from qemu_launcher

* QEMU_Launcher: Add stats to TUI

* More tui
2024-10-14 11:06:21 +02:00
Dominik Maier
1ad64e7ae7
Remove prelude from qemu_launcher (#2610) 2024-10-14 10:53:02 +02:00
Dominik Maier
d29b657bf4
Add LibAFL_Jumper util (#2594)
* Add jumper

* Hex Hex

* Fix hex decoding

* Cleanup readme

* Build with musl

* add mips delay slot back

* Added linker script

* More jump

* clippy

* taplo
2024-10-12 13:16:33 +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