13 Commits

Author SHA1 Message Date
d3fca27481 re-introduce native breakpoints 2025-07-23 08:41:26 +00:00
Romain Malmain
e0b8df9655
fix systemmode compilation 2025-04-30 13:47:55 +02:00
Romain Malmain
7633d5fce5
reorganize stuff 2025-04-29 14:26:42 +02:00
Romain Malmain
4df4d2dcfa
Add crash exit request (#106)
* add crash exit request.

* make it possible to choose between crashing methods
2025-03-14 16:57:23 +01:00
Volodymyr Babchuk
0b9d8266e4
Fix race between main thread and a vCPU thread (#102)
* afl-bridge: fix race between main thread and a vCPU thread

In some cases qemu_main_loop() can exit before libafl_sync_exit_cpu()
completes. This will case race between Rust code that restarts QEMU
and vCPU thread that updates last_exit_reason. What I observed is

libafl_exit_signal_vm_start() from a new iteration cleared
last_exit_reason.cpu before libafl_sync_exit_cpu() tried to
access *last_exit_reason.cpu. This caused NULL pointer dereference.

Fix this by not setting cpu->exit in prepare_qemu_exit() and updating
it only in rr_cpu_thread_fn() and MTTCG counterpart. This will ensure
that qemu_main_loop() waits for vCPU thread to actually stop before
returning control to the Rust code.

Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>

---------

Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
Co-authored-by: Romain Malmain <romain.malmain@pm.me>
2025-03-14 16:57:02 +01:00
Romain Malmain
7e0dc68430
Refactor read/write hooks (#99)
* Refactor read/write hooks
* add PC to the callbacks
* simplify code, merge common code
* remove useless tcg frees
* use tcg_constant_tl as much as possible, removing most #if in libafl code.
2025-01-27 12:32:35 +01:00
Romain Malmain
ace364678a
Nyx api support (#97)
* add nyx support

* target independent helper call.
2025-01-06 16:13:11 +01:00
Romain Malmain
0832bb4892
fix libafl side wih new version 2024-10-25 22:41:53 +02:00
Romain Malmain
d663793952
Early return from libafl edge generation if no exec hooks (#85)
* bug with edges in systemmode, not fixed yet

* timeout request only for systemmode
2024-09-20 13:42:52 +02:00
Romain Malmain
7f468ebba6
Second round of cleanups (#83)
* get rid of as many extern / function definition in QEMU codebase.

* mostly moved cpu / gdb related code.

* move qemu snapshot code in dedicated files.
2024-08-14 10:28:47 +02:00
Romain Malmain
86d38fbfa7
Add pre/post cpu_run hooks + Refactoring (#82)
* Add cpu_run pre/post exec hooks, to hook the cpu just before / after it runs target code.
* Refactor hooks to separate them in different files
* Remove most extern variables
* Reduce the amount of extra code in QEMU
* Add clang-format script
2024-08-13 16:56:00 +02:00
Romain Malmain
9f3e2399ee
QEMU host page size getter (#73)
* QEMU host page size getter
* Rename to sync_exit
2024-05-06 18:07:38 +02:00
Romain Malmain
50b0c90e0a
Moving libafl related files in dedicating folders (#60)
* Restructuration of libafl dirs. Formatting + export of maps struct and functions.

* Fix wrong header path.

* Fix misc path
2024-04-11 16:45:36 +02:00