Commit Graph

7596 Commits

Author SHA1 Message Date
b08f13c9fe code format 2025-06-10 10:01:55 +02:00
6f381d346b update Dockerfile to 24.04 2025-06-10 10:01:36 +02:00
78191557b2 Merge pull request #2462 from graux-pierre/dev
Modify the UID and GIDs of fuzzing target
2025-06-09 19:31:40 +02:00
00e5449ad6 fix and clean UID/GID modification 2025-06-09 16:33:16 +02:00
a63da7cdf6 Merge pull request #2465 from thesamesam/gcc16
instrumentation: drop removed TODO flag from GCC plugins
2025-06-09 10:42:41 +02:00
af0d023b3a Merge pull request #2466 from e-kwsm/python2
refactor!: drop python2
2025-06-09 10:41:14 +02:00
0975c8ddde refactor!: drop python2 2025-06-09 15:21:57 +09:00
7d017f1cb1 chore: modify help strings 2025-06-09 15:21:57 +09:00
a16bc3f36c instrumentation: drop removed TODO flag from GCC plugins
TODO_verify_il was removed in GCC trunk by 9739ae9384dd7cd3bb1c7683d6b80b7a9116eaf8,
so drop it here.
2025-06-08 13:06:54 +01:00
f9afbc822c Merge pull request #2464 from alexandredoyen29/warnf_for_setting_scheduling_for_main_fuzzer
WARNF for setting scheduling for main fuzzer instead of FATAL
2025-06-06 11:52:14 +02:00
1c7176bd96 Better message 2025-06-06 11:39:02 +02:00
ad44e30cbf Replace FATAL by WARNF when using another power scheduling with -M 2025-06-06 11:25:17 +02:00
0d495e0471 Merge pull request #2463 from jwpconsulting/mipsel-persistent-hook
Update test code and documentation for afl-fuzz qemu_mode on mipsel
2025-06-05 08:03:36 +02:00
9951c38515 Document QEMU persistent hook on mipsel
This adds a new persistent hook library `mipsel_read_into_a0.c`. With
it, you can test the persistent hook on the *mipsel* architecture.

I'm also updating the README in `utils/qemu_persistent_hook` and
Makefile and explain how to test the persistent hook on *mipsel*.

This all works thanks to qemuafl already having the correct CPU struct
for *mipsel* in `qemuafl/api.h`.

This patch also updates the root `.gitignore` file to ignore the two
test binaries `test` and `mipsel_test`.
2025-06-05 10:00:45 +09:00
ee480aeb7a Enable qemu persistent mode tests for mipsel
qemuafl now supports persistent mode for *mipsel* targets. This patch
changes the `SYS` variable tests and runs the persistent qemu_mode
tests for *mipsel* as well.

This also adds an optional environment variable called `CPU_TARGET_CC`
that you can pass to the `./test-qemu-mode.sh` test script.

This allows you to specify a cross-compiler for the target platform. The
test script then it uses to compile `test-instr.c` and `test-compcov.c`.

Example usage:

```
CPU_TARGET_CC=mipsel-linux-gnu-cc CPU_TARGET=mipsel ./test-qemu-mode.sh
```

The output should look something like this:

```
[*] Using environment variable CPU_TARGET=mipsel for SYS
[*] starting AFL++ test framework ...
[*] Testing: qemu_mode
[*] Using mipsel-linux-gnu-cc as compiler for target
[*] running afl-fuzz for qemu_mode, this will take approx 10 seconds
[+] afl-fuzz is working correctly with qemu_mode
[*] running afl-fuzz for qemu_mode AFL_ENTRYPOINT, this will take approx 6 seconds
[+] afl-fuzz is working correctly with qemu_mode AFL_ENTRYPOINT
[-] not an intel or arm platform, cannot test qemu_mode compcov
[-] not an intel or arm platform, cannot test qemu_mode cmplog
[*] running afl-fuzz for persistent qemu_mode, this will take approx 10 seconds
[+] afl-fuzz is working correctly with persistent qemu_mode
[+] persistent qemu_mode was noticeable faster than standard qemu_mode
[*] running afl-fuzz for persistent qemu_mode with AFL_QEMU_PERSISTENT_EXITS, this will take approx 10 seconds
[+] afl-fuzz is working correctly with persistent qemu_mode and AFL_QEMU_PERSISTENT_EXITS
[+] persistent qemu_mode with AFL_QEMU_PERSISTENT_EXITS was noticeable faster than standard qemu_mode
[-] we cannot test qemu_mode unsigaction library (32 bit) because it is not present
[+] qemu_mode unsigaction library (64 bit) ignores signals
[*] 1 test cases completed.
[-] not all test cases were executed
[+] all tests were successful :-)
```
2025-06-05 09:51:55 +09:00
c8d1b66af3 add AFL_FORKSRV_UID and AFL_FORKSRV_GID env vars 2025-06-04 15:21:02 +02:00
d25efff179 Merge pull request #2461 from jwpconsulting/env-user-variable
Let user pass their own CPU_TARGET in test-pre.sh
2025-06-04 08:39:33 +02:00
91974bfae2 Clean up test-pre.sh bash syntax
shellcheck pointed out a few command substition (backtick vs. $(...))
and quoting issues. This patch fixes them.
2025-06-04 09:33:03 +09:00
8618fbc0c2 Let user pass their own CPU_TARGET in test-pre.sh
The target system might be different from the host system. For example,
you can fuzz Linux binaries compiled for *mipsel*, while your host is
*x86_64*.

Some of the tests depend on specific platforms to run correctly.
For example, the afl-fuzz qemu_mode cmplog test only works on Intel or
ARM systems. The `SYS` variable is populated using `uname -m` and the
test cases then consult this variable to decide whether to run the test
or not.

If you want to test afl-fuzz for qemu_mode on mipsel, you might
want to make sure that Intel or ARM tests don't run. With this
patch, you can supply your own `CPU_TARGET` environment variable and skip
platform specific tests. `SYS` then contains the value of `CPU_TARGET`.

This allows you to add tests for *mipsel* or other niche platforms in
the future as well.

Sample usage:

```
$ cd qemu_mode && env CPU_TARGET=mipsel ./build_qemu_support.sh
$ cd ../test && env CPU_TARGET=mipsel ./test-qemu-mode.sh
[*] Using environment variable CPU_TARGET=mipsel for SYS
[*] starting AFL++ test framework ...
[*] Testing: qemu_mode
...
```
2025-06-04 09:31:13 +09:00
16cc444ae5 Merge pull request #2460 from AFLplusplus/dev
update frida
2025-05-30 18:14:52 +02:00
a9900f02cb Merge pull request #2459 from WorksButNotTested/update-frida
Update FRIDA again
2025-05-29 22:36:07 +02:00
e82de006a7 Update FRIDA again 2025-05-29 17:33:39 +01:00
4a923e59fd Update FRIDA (#2458) 2025-05-28 22:52:27 +02:00
20348a63bd Merge pull request #2455 from AFLplusplus/dev
enable llvm 21
2025-05-27 15:11:16 +02:00
cafcb343b1 enable llvm 21 2025-05-27 13:35:04 +02:00
588dda3e84 Merge pull request #2453 from AFLplusplus/dev
push to stable
2025-05-26 11:20:25 +02:00
a17d1daab8 deepwiki 2025-05-26 11:19:04 +02:00
affe7cf5b4 set errno=0 when no afl-fuzz present 2025-05-25 11:38:05 +02:00
fa1ac051eb Merge pull request #2451 from kcwu/revise-map-resize
Revise map resize
2025-05-25 11:08:05 +02:00
f21cc2da58 nit 2025-05-25 11:05:01 +02:00
8c1ab19ebe add libaflppdesock 2025-05-25 11:04:00 +02:00
2e7f191f3b extract function to resize map buffers 2025-05-25 09:33:34 +08:00
8090c82c63 fix resize afl->top_rated 2025-05-24 23:36:54 +08:00
f610f53838 remove redundent code
these field are already copied in afl_fsrv_init_dup
2025-05-24 22:28:26 +08:00
0012f710d8 Merge pull request #2450 from AFLplusplus/dev
push to stable
2025-05-24 13:24:03 +02:00
be00ea9f00 Merge pull request #2446 from kcwu/fix-save_if_interesting
fix save_if_interesting
2025-05-24 12:43:26 +02:00
d0df78f07a use functions instead of macros 2025-05-24 16:39:31 +08:00
7e1dc85450 nit 2025-05-23 09:19:42 +02:00
8152def40e changelog 2025-05-23 09:18:55 +02:00
e6ed31d550 Merge pull request #2449 from AFLplusplus/hidden
instrument all hidden edges
2025-05-23 09:16:17 +02:00
77758a1343 nits in calibrate_case 2025-05-23 08:50:37 +02:00
ea1fbb75b3 Merge pull request #2448 from kcwu/setup-ld-preload
Refactor and simplify handling of AFL_PRELOAD
2025-05-23 08:22:03 +02:00
d62a885f0f simplify code 2025-05-23 10:48:56 +08:00
55d534cd6d extract function afl_fsrv_setup_preload 2025-05-23 10:39:03 +08:00
cee764689c fix save_if_interesting
The value of `classified`, `bits_new`, and `cksum`, were not always
correctly maintained.
 1. In the past, `afl->queue_top->exec_cksum` was always assigned when
    `add_to_queue`, however it became conditional since cd57641705.
    This doesn't change correctness because calibrate_case() will
    calculate the checksum. However, this mean one calibration run is
    wasted.

 2. Sometimes `classified` is set incorrectly.
    For example, this code snippet
    ```
    new_bits = has_new_bits_unclassified(afl, afl->virgin_bits);
    classified = 1;
    ```
    should be changed to
    ```
    new_bits = has_new_bits_unclassified(afl, afl->virgin_bits);
    if (new_bits) classified = 1;
    ```

This commit fixed above issues and use macros to make the code easier to
understand. This should prevent to forget to set classified in the
future (like the bug fixed by 30c93d1321).

The macros also defers the calculations to where the values are really
needed. This could save cpu if the code returns earlier. For example,
if a case is timeout first and not timeout the second time, the current
code does classify_counts, which is not always needed.
2025-05-22 23:14:40 +08:00
d02390e62e add desock option 2025-05-22 17:08:12 +02:00
1f878f1b7c Merge pull request #2438 from AFLplusplus/dev
push to stable
2025-05-22 12:00:37 +02:00
ff1e0580b0 changelog 2025-05-22 12:00:10 +02:00
4730fa4226 Merge pull request #2444 from AFLplusplus/better_sync
Better sync
2025-05-22 11:55:53 +02:00
50fb923691 nit 2025-05-22 11:55:39 +02:00