7504 Commits

Author SHA1 Message Date
vanhauser-thc
ef0c236427 update fuzzing_in_depth 2025-05-14 16:45:23 +02:00
Leon
b6d1247e7d
fix incorrect allocation size for top_rated_candidates (#2424) 2025-05-14 10:31:31 +02:00
van Hauser
62e63d1125
Merge pull request #2423 from kcwu/more-stats-sync-foreign
show stats more frequently when sync foreign
2025-05-13 10:54:44 +02:00
vanhauser-thc
9e4449bad2 code format 2025-05-13 10:51:56 +02:00
van Hauser
6d4a56e481
Merge pull request #2421 from wtdcode/rename-afl-san-no-inst
Rename `AFL_SAN_NO_INST` to `AFL_FSRV_ONLY`
2025-05-13 10:51:08 +02:00
vanhauser-thc
221439fc7a fix foreign sync naming 2025-05-13 10:42:26 +02:00
mio
fca39a6ec3
implement AFL_GCC_ONLY_FSRV 2025-05-13 16:15:11 +08:00
mio
9476204da0
rename to AFL_LLVM_ONLY_FSRV 2025-05-13 15:45:33 +08:00
Kuang-che Wu
919108ee57 show stats more frequently when sync foreign
otherwise, the stats might have no updates for hours for large foreign directory
2025-05-13 15:22:50 +08:00
mio
8204bf6915
Allow afl-cmin.py for pre-3.12 by backport from more-itertools 2025-05-13 00:12:18 +08:00
mio
19fc27a3f7
update docs 2025-05-12 14:55:20 +08:00
mio
2357daebe0
update SAND docs accordingly 2025-05-12 14:46:29 +08:00
mio
f3995d5225
rename AFL_SAN_NO_INST to AFL_FSRV_ONLY 2025-05-12 14:43:08 +08:00
van Hauser
6b1d6a9055
Merge pull request #2418 from Evian-Zhang/memmem-no-nul
Do not include NUL when memmem
2025-05-09 09:22:24 +02:00
vanhauser-thc
4d9d8aaf16 afl-cmin.py nits 2025-05-09 09:12:37 +02:00
van Hauser
c150d8e17d
Merge pull request #2413 from kcwu/afm-cmin
add afl-cmin.py
2025-05-09 09:09:08 +02:00
Evian-Zhang
61e97a8ceb Do not match NUL when memmem 2025-05-09 09:46:05 +08:00
Kuang-che Wu
3f2e03aaf9 call afl-cmin.py if it can be executed successfully 2025-05-08 21:52:12 +08:00
Kuang-che Wu
ec27e96486 reformat by black 2025-05-06 23:45:42 +08:00
vanhauser-thc
b1730d99b6 new LLVM defaults! 2025-05-05 17:46:01 +02:00
vanhauser-thc
6d45b286f8 nits 2025-05-05 14:35:52 +02:00
van Hauser
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
Alexandre DOYEN
f580fefc5f Doc 2025-05-05 11:12:51 +02:00
Alexandre DOYEN
320d4b7ef8 Requested changes 2025-05-05 11:03:26 +02:00
Alexandre DOYEN
19bd2984d5 Writing style mistaske 2025-05-05 10:52:27 +02:00
Alexandre DOYEN
7d29418db5 Auxiliary variable for afl-forkserver.c too 2025-05-05 10:50:13 +02:00
Alexandre DOYEN
4d984d6e2b getenv() call at the beginning of __afl_start_forkserver() 2025-05-05 10:44:34 +02:00
van Hauser
421b6492d3
Merge pull request #2414 from kcwu/refactor
Minor refactor and clean up
2025-05-05 10:42:03 +02:00
Kuang-che Wu
062f883160 add splice_optout_py prototype 2025-05-05 16:16:42 +08:00
Alexandre DOYEN
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
Alexandre DOYEN
e9f49527e9 We check before if the AFL_PRELOAD env variable is set 2025-05-05 09:49:56 +02:00
Alexandre DOYEN
6f4767ea81 AFL_I_AM_THE_FORKSERVER becomes AFL_FORKSERVER_PARENT 2025-05-05 09:42:33 +02:00
van Hauser
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
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