7521 Commits

Author SHA1 Message Date
vanhauser-thc
d10b85421d update qemuafl 2025-05-05 09:36:23 +02:00
Kuang-che Wu
6876ab7901 remove dead prototype 2025-05-05 08:46:49 +08:00
Kuang-che Wu
b1649f2fdb nyx nit 2025-05-05 08:44:26 +08:00
Kuang-che Wu
701299eefd remove dead code; we no longer use murmurhash 2025-05-05 08:44:26 +08:00
Kuang-che Wu
90e929ea17 only reinit shm map when make sense 2025-05-05 08:44:26 +08:00
Kuang-che Wu
24dc7b569c nit: simplify code
"!target_hash" already cover "afl->fsrv.nyx_mode && target_hash == 0"
2025-05-05 08:44:26 +08:00
Kuang-che Wu
7cb8ccc960 mention afl-cmin.py in afl-cmin 2025-05-04 19:35:55 +08:00
Kuang-che Wu
0c4f8934c7 add afl-cmin.py 2025-05-04 19:06:55 +08:00
Alexandre DOYEN
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
van Hauser
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
Scott Guest
d40f935b4e Disable GCC instrumentation for AFL_SAN_NO_INST 2025-05-02 17:25:16 -07:00
Justus Perlwitz
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
vanhauser-thc
04f2a2dd09 ignore unnecessary warnings for tools 2025-04-29 15:55:14 +02:00
van Hauser
aa1c58a077
Merge pull request #2408 from smoelius/color-no-ui-output
Color `AFL_NO_UI` output
2025-04-29 10:38:52 +02:00
van Hauser
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
Scott Guest
c4be2ec32f utils/libdislocator/Makefile: Add missing override directive to CFLAGS+= 2025-04-28 20:52:15 -07:00
Samuel Moelius
83a2a8aa14 Color AFL_NO_UI output 2025-04-28 20:29:10 -04:00
vanhauser-thc
6c70d68783 update make flags 2025-04-28 22:09:58 +02:00
vanhauser-thc
6d5784e955 lower values for fuzzing state assessment 2025-04-28 19:30:07 +02:00
vanhauser-thc
5f7009d6e9 code format 2025-04-28 14:23:17 +02:00
van Hauser
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
vanhauser-thc
f43116d9e0 more classified count fixes 2025-04-28 14:22:37 +02:00
van Hauser
876a528156
Merge pull request #2403 from kcwu/fix-aflfast
fix power schedules
2025-04-28 14:12:22 +02:00
vanhauser-thc
8a0e9c8915 minimum llvm 14 in docs 2025-04-28 14:03:12 +02:00
Marian Buschsieweke
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
Kuang-che Wu
30c93d1321 fix power schedules
AFLFast power schedules regressed since v4.31c
2025-04-27 00:07:06 +08:00
vanhauser-thc
e30a17be91 v4.33a init 2025-04-26 15:57:30 +02:00
van Hauser
c340a022e2
Merge pull request #2401 from AFLplusplus/dev
v4.32c release
v4.32c
2025-04-26 15:36:45 +02:00
vanhauser-thc
06219b4d56 v4.32c 2025-04-26 15:35:47 +02:00
vanhauser-thc
c5b8f4250e code format 2025-04-26 15:30:56 +02:00
van Hauser
779cb5d942
Merge pull request #2400 from AFLplusplus/dev
push to stable
2025-04-26 15:30:18 +02:00
vanhauser-thc
fb1a41f5af fix 2025-04-26 13:24:21 +02:00
vanhauser-thc
8352f0a89f fix LLVM 20 pass pipeline insertion 2025-04-26 13:20:51 +02:00
vanhauser-thc
9935190c7b drop llvm 13 AFL++ plugin support 2025-04-25 18:37:19 +02:00
vanhauser-thc
e3ee26262f fix AFL_OLD_FORKSERVER 2025-04-25 13:42:19 +02:00
van Hauser
737c13b460
Merge pull request #2386 from 5angjun/dev
Add someone else to the "list of contributors" :)
2025-04-25 10:03:37 +02:00
van Hauser
9836598d65
Merge pull request #2398 from kcwu/fix-minor
Minor fixes
2025-04-25 10:03:23 +02:00
Kuang-che Wu
63509fb696 fix afl-cmin message output 2025-04-25 11:51:34 +08:00
Kuang-che Wu
d1c44e12a8 remove dead comment 2025-04-25 11:51:20 +08:00
Kuang-che Wu
f78ed6eabc remove redundent code 2025-04-25 11:51:08 +08:00
Kuang-che Wu
64c942d0c9 fix printf format 2025-04-25 11:50:50 +08:00
Sangjun Park
50e343a0d0
Merge branch 'dev' into dev 2025-04-25 11:23:33 +09:00
5angjun
55719ab23b Resolve merge conflict in README.md 2025-04-25 11:19:52 +09:00
van Hauser
d12c5edd59
Merge pull request #2395 from ryberger-nvidia/fix-infinite-loop
fix infinite loop when custom mutator rejects smallest_favored
2025-04-24 16:04:41 +02:00
vanhauser-thc
1b82d6b904 fix for nit in afl-tmin 2025-04-24 14:42:32 +02:00
Ryan Berger
61201fbbb8 fix infinite loop when custom mutator rejects smallest_favored
When running with custom mutators, afl-fuzz delegates the responsibility of queuing to` afl_custom_queue_get`
implemented by the mutator. If any mutator cannot process the input, then it is rejected. After an input is rejected
then a new suitable item to queue must be found. Before this PR, that would be `smallest_favored`. However,
if `smallest_favored` were rejected, it would not be cleared from its position as  `smallest_favored` meaning it
would be attempted to be queued again catching afl-fuzz in an infinite loop.

To fix it, we simply return that we skipped the entry, along with using a `goto abandon_entry` to clean the entry up so that
the fuzzer never considers the input again
2025-04-23 14:47:55 -07:00
vanhauser-thc
b9458e72e7 nit 2025-04-23 16:42:49 +02:00
vanhauser-thc
5045f9e615 code format 2025-04-21 11:45:33 +02:00
van Hauser
6cd8a0168f
Merge pull request #2391 from kcwu/fix-__AFL_COVERAGE
fix __AFL_COVERAGE: multiple definition of `__afl_selective_coverage`
2025-04-21 11:45:05 +02:00
Kuang-che Wu
448c6c212d fix __AFL_COVERAGE: multiple definition of __afl_selective_coverage
fix #2390
2025-04-21 09:02:23 +00:00