45 Commits

Author SHA1 Message Date
Dongjia "toka" Zhang
78060ea308
0.11.2 (#1735) 2023-12-18 14:33:14 +01:00
Andrea Fioraldi
517d6962bd
Fix QEMU userspace crash handler (#1706)
* Fix QEMU userspace crash handler

* no_std
2023-12-01 13:26:10 +01:00
Andrea Fioraldi
5d83c9399a
Fix bp in QEMU thumb mode on arm64 systems (#1701) 2023-11-29 10:37:10 +01:00
Andrea Fioraldi
bc458864f1
Fix libafl_qemu edge hooks src addr (#1700) 2023-11-28 17:16:15 +01:00
Andrea Fioraldi
1545514ed8
JIT fast path for edge cov hooks in libafl_qemu (#1696)
* JIT fast path for edge cov hooks in libafl_qemu

* fix

* fmt

* fix

* unify hooks as opt
2023-11-27 13:20:20 +01:00
Romain Malmain
bd12e060ca
Update qemu-libafl-bridge (#1697)
Update to last version of qemu-libafl-bridge
2023-11-24 20:19:57 +01:00
Andrea Fioraldi
f1aee3c376
Refactor QEMU hooks (#1690)
* Rewrite QEMU Asan

* fake sys

* New hooks

* edge cov helper

* opaque raw hook

* new hooks

* EMulator::get

* new asan

* fix fuzzers

* fix types

* fix

* fix

* fix

* merge fix

* fix
2023-11-23 18:57:15 +01:00
Romain Malmain
43c9100f59
QEMU Synchronous Exit + Syx Snapshot update (#1681)
* Fix: typo in variable name.

* Fix: thread-safe static for emulator initialization.

* Initial support for synchronous exit from QEMU.

* New commands for the sync exit feature.
Supports physical and virtual address requests.
Updated for new SyxSnapshot naming.

* update qemu commit and fix some things

* - Removed lazy_static dependency
- Compiles for usermode
- Format

* Fix warnings

* Fixed sync_exit for missing architectures

---------

Co-authored-by: Andrea Fioraldi <andreafioraldi@gmail.com>
2023-11-23 17:35:32 +01:00
Andrea Fioraldi
cc1ebb29f7
Add CmpLog routines to LibAFL QEMU and various fixes (#1664)
* Add CmpLog routines to LibAFL QEMU and various fixes

* format

* fix

* fix read_function_argument

* fix

* multithread

* fix qemu fork

* fix

* clippy

* fix systemmode

* unused imports
2023-11-17 16:59:50 +01:00
Andrea Fioraldi
406e77faa9
QEMU Asan backtrace and report (#1628)
* wip

* ExtractFirstRefMutType

* Asan report with backtrace

* Print asan reports and fix backtraces in libafl qemu

* print context

* enlarge redzone

* nopstate

* fix

* reproducer

* clippy

* clippy

* Fix android

* Crash hook
2023-10-25 15:58:32 +02:00
Andrea Fioraldi
31f4669794
Autodetect llvm-config for QEMU bindings generation (#1610)
* Autodetect llvm-config for QEMU bindings generation

* fix ci

* Fix signal handlers without ucontext pointer

* ci
2023-10-10 15:26:32 +02:00
Andrea Fioraldi
cffbf069d2
Call the original QEMU user crash handler in libafl_qemu (#1575)
* Call the original QEMU user crash handler in libafl_qemu

* Return if real crash or not

* merge

* Fix singal handlers in libafl and libafl_qemu

* doc and clippy

* clippy

* clippy

* clippy

* slirp

* fix

* fix system
2023-10-05 15:24:21 +02:00
Dongjia "toka" Zhang
60b3408737
Update dependencies (#1588)
* update

* downgrade some
2023-10-01 07:20:23 -05:00
WorksButNotTested
9c3f8f4511
Qemu features3 (#1538)
* Fix issue with libafl_qemu being repeatedly rebuilt

* Changes to make qemu_launcher a production ready fuzzer

* Remove _get prefix

* Don't collect DrCov data during the campaign

* Fix poor performance

* Better validation for core selection

* Changes to print debug when running in verbose mode

* Autofix

* Remove afl++-clang

* Fix build error on 32-bit

* Fix some clippy

* Fix OSX

* Set default version of clang/clang++

* Review changes

* Fix issue with fd sharing between processes

---------

Co-authored-by: Your Name <you@example.com>
Co-authored-by: Andrea Fioraldi <andreafioraldi@gmail.com>
2023-09-28 14:31:15 +02:00
Andrea Fioraldi
4c0e01c4aa
Fix memopidx bug in libafl_qemu r/w hooks and update QEMU (#1500) 2023-09-05 16:28:52 +02:00
Andrea Fioraldi
00033426e7
Bump to 0.11.1 (#1491) 2023-08-31 15:07:31 +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
Andrea Fioraldi
04c8d5208b
qemu: Fix cpu page size function for full-system (#1452)
* Revert "qemu: add cpu page_size call (#1433)"

This reverts commit d338b30c080ecfe1a6639185b6505b7a7b8edbeb.

* Reintroduce page_size
2023-08-25 11:42:23 +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
David CARLIER
d338b30c08
qemu: add cpu page_size call (#1433)
* qemu handy cpu page size call proposal.

* changes from feedback.
2023-08-23 20:27:58 +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
Andrea Fioraldi
ac4a0e7330
libafl_qemu snapshot device filter (#1386)
* libafl_qemu snapshot device filter

* Working device list

* regenerate bindings stub
2023-08-01 12:01:10 +02:00
Andrea Fioraldi
37bfead4e5
Fix generic hooks bug in libafl_qemu (#1382) 2023-07-27 17:28:33 +02:00
Andrea Fioraldi
cb24b5dc2d
Extract linker args when building QEMU (#1377)
* Update qemu commit

* Hook the linker and automatically extract linker args

* Comment code
2023-07-26 10:42:15 +02:00
Dominik Maier
36b1d8aea2
Fix status updates for crashing fuzzers (fixes #1367) (#1368)
* Fix status updates for crashing fuzzers (fixes #1367)

* client perf fix

* Add HasLastReportTime trait :/

* ****** prelude

* reoder phantom

* fix tests

* clippy, fixes

* more fixes, traits are maaad

* fmt
2023-07-14 18:50:31 +02:00
Langston Barrett
2885b10f70
libafl_qemu_build: Bump bindgen to 0.66 for syn 2 support (#1349) 2023-07-10 13:12:26 +02:00
Ivan Fratric
829b5049e6
Hexagon support (#1323)
* Hexagon support

* Fix format

* Fix needless bool

* Address comments

---------

Co-authored-by: Andrea Fioraldi <andreafioraldi@gmail.com>
2023-07-04 11:08:36 +02:00
Andrea Fioraldi
356698c24b
Update to QEMU 8 (#1299)
* Update to QEMU 8

* fix

* fix snapshots

* fix pcrel
2023-06-02 18:24:07 +02:00
WorksButNotTested
53dd6c6be6
Post gen (#1282)
* Add post_gen

* Adopt post_gen hooks in DrCovHelper

* Bump qemu-libafl-bridge revision

---------

Co-authored-by: Your Name <you@example.com>
Co-authored-by: Andrea Fioraldi <andreafioraldi@gmail.com>
2023-05-24 16:03:59 +02:00
Dongjia "toka" Zhang
6f21cb3848
Bump to 0.10.1 (#1280)
* bmp

* remove DEBUG env var
2023-05-22 12:42:36 +02:00
WorksButNotTested
4029069640
Disable capstone when building qemu-afl-bridge for user-mode fuzzing (#1281)
Co-authored-by: Your Name <you@example.com>
2023-05-18 00:47:59 +02:00
intrigus-lgtm
91b10f8c40
LibAFL_qemu: Disable Capstone to fix build issues on some distributions (#1263) 2023-05-11 09:52:57 +02:00
Andrea Fioraldi
0f633962ff
Bump to 0.10.0 (#1156)
* Bump to 0.10.0

* fix

* Fix CI

* Fix copyright

* fmt

---------

Co-authored-by: Dominik Maier <domenukk@gmail.com>
Co-authored-by: Dongjia "toka" Zhang <tokazerkje@outlook.com>
2023-04-05 17:49:53 +02:00
Dominik Maier
0d446bab20
Updated dependencies (#1174)
* Updated deps

* win

* Revert "win"

This reverts commit a6dfd95f1c63a9471659481d92c5cbc480af6360.

* revert win

---------

Co-authored-by: Dongjia "toka" Zhang <tokazerkje@outlook.com>
2023-04-04 22:58:00 +02:00
Andrea Fioraldi
dc800f0814
on_evaluation Scheduler method (#1106)
* add on evaluation hook in schedulers

* on_evaluation for WeightedScheduler

* fix PowerQueueScheduler

* fix fuzzers

* upd qemu

* tests

* upd
2023-02-28 11:33:26 +01:00
Dongjia "toka" Zhang
59bf118a5a
Clippy (#1105) 2023-02-28 01:08:19 +09:00
R. Elliott Childre
4d5a759955
Update deps for libafl (#1042)
Reduces total number of packages from 577 to 571 on building with:
`cargo +nightly build --workspace --all-features`

* ahash 0.7 -> 0.8
  * Move `AHasher::new_with_keys` to `RandomState::with_seeds` given the
    recommendation from: aHash maintainer:
    https://github.com/tkaitchuck/aHash/issues/132#issuecomment-1288207069

* bindgen: 0.61 -> 0.63

* c2rust-bitfields: 0.3 -> 0.17

* criterion: 0.3 -> 0.4

* crossterm: 0.25 -> 0.26

* dynasmrt: 1.2 -> 2

* goblin: 0.5.3 -> 0.6

* hashbrown: 0.12 -> 0.13

* nix: 0.25 -> 0.26
  * The `addr` arg of `mmap` is now of type `Option<NonZeroUsize>`
  * The `length` arg of `mmap` is now of type `NonZeroUsize`
  * Requires updating implementers to update `nix` as well

* prometheus-client: 0.18.0 -> 0.19
  * Do not box metrics
  * Gauges (a majority of the LibAFL metrics) are now i64 types so there
    is a small chance of overflow, with the u64 values that LibAFL
    tracks, but unlikely to be problematic.
 * Keep `exec_rate` as a floating point value

* serial_test: 0.8 -> 1

* typed-builder: 0.10.0 -> 0.12

* windows: 0.42.0 -> 0.44

Co-authored-by: Dominik Maier <domenukk@gmail.com>
2023-02-06 12:24:42 +01:00
Andrea Fioraldi
fdf579bcd5
Bump to 0.9.0 (#946)
* bump to 0.9.0

* fix libafl_tinyinst

* fix

---------

Co-authored-by: Dominik Maier <domenukk@gmail.com>
2023-01-31 10:42:01 +01:00
Andrea Fioraldi
7fd9ac0952
SyncFromBrokerStage to sync from a broker with a different Input type (#997)
* ConverterLlmpEventManager

* docs

* SyncFromBrokerStage

* fix

* separate InputConverter

* nautilus

* nautilus_sync

* send testcases

* upd nautilus

* meta

* fix

* clippy

* fix

* Update build_and_test.yml

* fix

* fix

* Use find_libpython

* ci

* upd qemu
2023-01-20 17:16:29 +01:00
Andrea Fioraldi
3c8a00bc42
Fix qemu user (#1003) 2023-01-18 13:38:49 +01:00
Andrea Fioraldi
7cf7d545a6
Update QEMU and fix snapshot restore mem leak (#998)
* Update qemu

* Fix leak

* upd

* fmt
2023-01-17 11:06:31 +01:00
biazo
3345727c94
fixing linking issue on qemu build (#990)
* fixing linking issue

* insteading of linking lib we dont use. just disable them

* fixing the keyutils problem

Co-authored-by: Andrea Fioraldi <andreafioraldi@gmail.com>
2023-01-09 10:10:14 +01:00
Andrea Fioraldi
50708f4d9c
Fast device+mem QEMU snapshots (#930)
* Simple fast root snapshots

* clippy

* epd

* mips
2022-12-12 10:49:44 +01:00
Dominik Maier
68fbfc8914
Fix Clippy (#926)
* Fix clippy

* undo comment fmt

* add unstracked nyx files to gitignore

* fix

* windows, no_std

* fix

* fix

* more

* macos

* remove doctest

Co-authored-by: Dongjia "toka" Zhang <tokazerkje@outlook.com>
2022-12-06 00:05:42 +09:00
Andrea Fioraldi
71dd58396c
libafl_qemu_sys and libafl_qemu_build to have bindgen with QEMU (#915)
* build and sys qemu crates

* working libafl_qemu_build

* libafl_qemu_sys

* switch libafl_qemu to use libafl_qemu_sys

* fix

* use sys

* fmt

* mmu lookup

* fix

* autofix

* clippy

* fix

* allow

* cl

* docker

* docker

* fix

* mem access info in mem hooks

* fmt

* fix

* kill libafl_page_size

* fix

* clippy

* default bindings for docs.rs

* macos

* fix arm build

* fix

* plugins

* fix

* fix fuzzer

* Correct PC on breakpoint

Co-authored-by: Dominik Maier <domenukk@gmail.com>
2022-12-02 17:01:28 +01:00