Commit Graph

7491 Commits

Author SHA1 Message Date
adeaa714ce do not instrument icmp/fcmp if result is used in select 2025-05-11 19:27:23 +02:00
231a4b1937 fix fcmp 2025-05-09 17:14:44 +02:00
977e08cda1 fix fcmp + icmp for vectors 2025-05-09 17:07:54 +02:00
406e4880c7 remove phi instrumentation 2025-05-08 09:36:05 +02:00
22b7d370bc try different intrumentation strategy 2025-05-07 19:01:51 +02:00
fcca917f4f better variable following 2025-05-06 17:22:10 +02:00
5bf01afd6b fix 2025-05-06 14:40:08 +02:00
0a9916deab instrument hidden selects 2025-05-06 14:16:50 +02:00
b1730d99b6 new LLVM defaults! 2025-05-05 17:46:01 +02:00
6d45b286f8 nits 2025-05-05 14:35:52 +02:00
673463ff1c Merge pull request #2412 from alexandredoyen29/environment_forkserver
Environment variable to discriminate the target and the forkserver
2025-05-05 14:30:40 +02:00
f580fefc5f Doc 2025-05-05 11:12:51 +02:00
320d4b7ef8 Requested changes 2025-05-05 11:03:26 +02:00
19bd2984d5 Writing style mistaske 2025-05-05 10:52:27 +02:00
7d29418db5 Auxiliary variable for afl-forkserver.c too 2025-05-05 10:50:13 +02:00
4d984d6e2b getenv() call at the beginning of __afl_start_forkserver() 2025-05-05 10:44:34 +02:00
421b6492d3 Merge pull request #2414 from kcwu/refactor
Minor refactor and clean up
2025-05-05 10:42:03 +02:00
062f883160 add splice_optout_py prototype 2025-05-05 16:16:42 +08:00
a76ff5e798 Specific environment variable to choose if we want to be able to discriminate or not forkserver in preloaded libraries 2025-05-05 09:54:53 +02:00
e9f49527e9 We check before if the AFL_PRELOAD env variable is set 2025-05-05 09:49:56 +02:00
6f4767ea81 AFL_I_AM_THE_FORKSERVER becomes AFL_FORKSERVER_PARENT 2025-05-05 09:42:33 +02:00
d28b1418a2 Merge pull request #2410 from jwpconsulting/test-persistent-exit
Add test case for AFL_QEMU_PERSISTENT_EXITS
2025-05-05 09:37:53 +02:00
d10b85421d update qemuafl 2025-05-05 09:36:23 +02:00
6876ab7901 remove dead prototype 2025-05-05 08:46:49 +08:00
b1649f2fdb nyx nit 2025-05-05 08:44:26 +08:00
701299eefd remove dead code; we no longer use murmurhash 2025-05-05 08:44:26 +08:00
90e929ea17 only reinit shm map when make sense 2025-05-05 08:44:26 +08:00
24dc7b569c nit: simplify code
"!target_hash" already cover "afl->fsrv.nyx_mode && target_hash == 0"
2025-05-05 08:44:26 +08:00
cd0cb1e731 Setting the AFL_I_AM_THE_FORKSERVER environment variable in the begining of the forkserver child process, and unsetting it when the target is launched 2025-05-04 11:36:01 +02:00
52631d925d Merge pull request #2411 from Scott-Guest/gcc-sand
Disable GCC instrumentation for AFL_SAN_NO_INST
2025-05-03 09:38:39 +02:00
d40f935b4e Disable GCC instrumentation for AFL_SAN_NO_INST 2025-05-02 17:25:16 -07:00
b418a87340 Add test case for AFL_QEMU_PERSISTENT_EXITS
Add a test case to `test/test-qemu-mode.sh` and make sure that
AFL_QEMU_PERSISTENT_EXITS loops correctly.

This works only on platforms for which `afl-qemu-trace` detects exit
signals and resets the program counter.

This commit updates `test-instr.c` to optionally call `exit(n)` instead of
returning n to the operating system. This option can be activated using
the `EXIT_AT_END` flag. This way, we can test the
QEMU persistent exit mode without having to add a new test file.

You can compile and run `test-instr.c` with the exit mode like so:

```bash
gcc -o exit -DEXIT_AT_END test-instr.c
AFL_QEMU_DEBUG_MAPS= \
    AFL_DEBUG= \
    AFL_QEMU_PERSISTENT_ADDR=$(readelf -a exit | grep 'main$' | awk '{ printf "0x%s", $2 }') \
    AFL_QEMU_PERSISTENT_GPR=1 \
    AFL_QEMU_PERSISTENT_EXITS=1 \
    ./afl-qemu-trace exit
```

Press enter repeatedly and you will see an output like this:

```
...
Debug: Sending status 0xc201ffff

test-instr:

Neither one or zero? How quaint!

test-instr:

Neither one or zero? How quaint!

test-instr:

Neither one or zero? How quaint!

test-instr:

Neither one or zero? How quaint!

test-instr:

Neither one or zero? How quaint!
```

To make sure that persistent exits are detected correctly on x86_64, I've made
the following changes to qemuafl:

```
 linux-user/i386/cpu_loop.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/linux-user/i386/cpu_loop.c b/linux-user/i386/cpu_loop.c
index 4509f46b95..46bdbaf94a 100644
--- a/linux-user/i386/cpu_loop.c
+++ b/linux-user/i386/cpu_loop.c
@@ -235,7 +235,7 @@ void cpu_loop(CPUX86State *env)
 #ifndef TARGET_ABI32
         case EXCP_SYSCALL:
             /* linux syscall from syscall instruction */
-            if (afl_fork_child && persistent_exits &&
+            if (persistent_exits &&
                 env->regs[R_EAX] == TARGET_NR_exit_group) {
               env->eip = afl_persistent_addr;
               continue;
```
2025-05-02 15:13:08 +09:00
04f2a2dd09 ignore unnecessary warnings for tools 2025-04-29 15:55:14 +02:00
aa1c58a077 Merge pull request #2408 from smoelius/color-no-ui-output
Color `AFL_NO_UI` output
2025-04-29 10:38:52 +02:00
cca5538747 Merge pull request #2409 from Scott-Guest/libdislocator-cflags
Add missing override directive for CFLAGS+= in libdislocator
2025-04-29 10:37:41 +02:00
c4be2ec32f utils/libdislocator/Makefile: Add missing override directive to CFLAGS+= 2025-04-28 20:52:15 -07:00
83a2a8aa14 Color AFL_NO_UI output 2025-04-28 20:29:10 -04:00
6c70d68783 update make flags 2025-04-28 22:09:58 +02:00
6d5784e955 lower values for fuzzing state assessment 2025-04-28 19:30:07 +02:00
5f7009d6e9 code format 2025-04-28 14:23:17 +02:00
48bce88050 Merge pull request #2406 from maribu/config/64-bit
Define WORD_SIZE_64 for more 64-bit arches
2025-04-28 14:22:53 +02:00
f43116d9e0 more classified count fixes 2025-04-28 14:22:37 +02:00
876a528156 Merge pull request #2403 from kcwu/fix-aflfast
fix power schedules
2025-04-28 14:12:22 +02:00
8a0e9c8915 minimum llvm 14 in docs 2025-04-28 14:03:12 +02:00
b083016304 Define WORD_SIZE_64 for more 64-bit arches
This enables 64-bit detection for the following additional systems:

- [PowerPC64 (little endian)](https://en.wikipedia.org/wiki/Ppc64)
- [S390x](https://en.wikipedia.org/wiki/S390x)
- [LoongArch64](https://en.wikipedia.org/wiki/LoongArch64)
2025-04-28 07:58:09 +02:00
30c93d1321 fix power schedules
AFLFast power schedules regressed since v4.31c
2025-04-27 00:07:06 +08:00
e30a17be91 v4.33a init 2025-04-26 15:57:30 +02:00
c340a022e2 Merge pull request #2401 from AFLplusplus/dev
v4.32c release
v4.32c
2025-04-26 15:36:45 +02:00
06219b4d56 v4.32c 2025-04-26 15:35:47 +02:00
c5b8f4250e code format 2025-04-26 15:30:56 +02:00