Commit Graph

2173 Commits

Author SHA1 Message Date
96848398d4 fix 2023-04-25 17:56:36 +02:00
21865c6224 rename env to AFL_IGNORE_PROBLEMS_COVERAGE 2023-04-25 16:47:37 +02:00
d822181467 afl-cmin -T support 2023-04-25 13:13:43 +02:00
bc969f78f6 fixes 2023-04-25 11:56:50 +02:00
c0ecf7cf61 only reverse reading the queue on restart 2023-04-25 08:33:51 +02:00
b66d7f99a7 Merge pull request #1713 from kenohassler/wafl-mode
llvm-lto: allow skipping initialisation
2023-04-25 08:21:42 +02:00
7c3c0b26d1 document new env var 2023-04-24 20:32:04 +02:00
8c228b0d23 afl-showmap -I option 2023-04-24 18:08:27 +02:00
c5e5a17d67 Merge pull request #1711 from atnwalk/atnwalk
AFL_POST_PROCESS_KEEP_ORIGINAL env variable for intermediate file formats and ATNwalk custom mutator
2023-04-22 11:32:42 +02:00
599b4631a3 typo 2023-04-22 11:31:29 +02:00
228e9527cb fixed formatting with make code-format 2023-04-21 17:21:47 +02:00
e99d4ba976 Merge pull request #2 from AFLplusplus/dev
Dev
2023-04-21 16:48:47 +02:00
779a72ef8c fixed AFL_POST_PROCESS_KEEP_ORIGINAL for version 4.07a 2023-04-21 16:46:15 +02:00
7a8d0a10ce add dummy functions to afl-showmap for old gcc compilers 2023-04-21 15:21:11 +02:00
0a297ed9ef dummy function for afl-showmap 2023-04-21 15:09:35 +02:00
7101ffa1ae Merge remote-tracking branch 'origin/dev' into atnwalk
# Conflicts:
#	include/afl-fuzz.h
#	src/afl-fuzz-run.c
2023-04-21 11:31:22 +02:00
4e5f42cab6 afl-showmap custom mutator support 2023-04-20 10:39:23 +02:00
9ab902402c fixed code clones in atnwalk.c, introduced new environment variable AFL_POST_PROCESS_KEEP_ORIGINAL in AFL++ to integrate atnwalk without re-compiling afl-fuzz 2023-04-17 17:09:48 +02:00
450dbae8cd first version with unix domain sockets is ready for testing 2023-04-17 17:09:48 +02:00
56f7e3aa08 hidden -Y option for nyx, code format 2023-04-16 12:42:32 +02:00
87b9dc4ba0 Merge pull request #1702 from schumilo/dev
add Nyx support in afl-showmap, afl-tmin, afl-cmin and afl-analyze
2023-04-16 12:24:10 +02:00
d0b86bf055 pass absolute paths to libnyx 2023-04-16 06:23:38 +02:00
61aeb44863 remove redundant access() call 2023-04-16 05:19:09 +02:00
059d470e8d improved Nyx tmp dir handling (additional sanity checks) 2023-04-16 04:42:09 +02:00
47833bcf9e fix remove_nyx_tmp_workdir function 2023-04-16 04:28:19 +02:00
8f6d9d66ef fix post_process 2023-04-15 09:11:33 +02:00
c34c3e2f5f add some sanity checks and remove duplicate nyx_shutdown calls 2023-04-14 06:24:46 +02:00
4f6ec6cb08 add NYX_REUSE_SNAPSHOT env-var option 2023-04-14 06:21:43 +02:00
a96cdc649f switch to latest libnyx API 2023-04-14 05:59:12 +02:00
eefd98f374 add Nyx support in various tools (like afl-cmin) 2023-04-14 02:25:33 +02:00
f756734ad2 fix attempt at post_process implementation 2023-04-13 12:07:27 +02:00
6cc8d607fb remove -z option, use -p mmopt instead 2023-04-13 11:44:39 +02:00
a5a122a533 Merge pull request #1698 from neuschaefer/nodefer
afl-cc: Don't offer __AFL_INIT() etc. in GCC/CLANG modes
2023-04-10 17:50:11 +02:00
9e3e1a5512 afl-cc: Don't offer __AFL_INIT() etc. in GCC/CLANG modes
instrumentation/README.persistent_mode.md documents in the section about
deferred forkserver initialization:

> With the location selected, add this code in the appropriate spot:
>
> ```c
> #ifdef __AFL_HAVE_MANUAL_CONTROL
>   __AFL_INIT();
> #endif
> ```
>
> You don't need the #ifdef guards, but including them ensures that the program
> will keep working normally when compiled with a tool other than afl-clang-fast/
> afl-clang-lto/afl-gcc-fast.
>
> Finally, recompile the program with afl-clang-fast/afl-clang-lto/afl-gcc-fast
> (afl-gcc or afl-clang will *not* generate a deferred-initialization binary) -
> and you should be all set!


This strongly implies that you can compile a program that uses __AFL_INIT()
under an `#ifdef __AFL_HAVE_MANUAL_CONTROL` guard with afl-gcc/-clang.

However, this currently fails:

  $ cat example.c
  #include <stdio.h>

  int main(void) {
  #ifdef __AFL_HAVE_MANUAL_CONTROL
  	__AFL_INIT();
  #endif

  	puts("Hello");
  }
  $ afl-gcc example.c -o example
  afl-cc++4.06a by Michal Zalewski, Laszlo Szekeres, Marc Heuse - mode: GCC-GCC
  [!] WARNING: You are using outdated instrumentation, install LLVM and/or gcc-plugin and use afl-clang-fast/afl-clang-lto/afl-gcc-fast instead!
  afl-as++4.06a by Michal Zalewski
  [+] Instrumented 1 locations (64-bit, non-hardened mode, ratio 100%).
  /usr/bin/ld: /tmp/ccuJHcpt.o: in function `main':
  /home/jn/dev/fuzz/AFLplusplus/example.c:5: undefined reference to `__afl_manual_init'
  collect2: error: ld returned 1 exit status


The issue here is an inconsistency in afl-gcc (i.e. afl-cc operating in GCC mode):

 - afl-cc defines __AFL_HAVE_MANUAL_CONTROL and __AFL_INIT unconditionally
 - __AFL_INIT relies on __afl_manual_init, which is defined in afl-compiler-rt.o
 - afl-cc doesn't link afl-compiler-rt in GCC or CLANG mode


Since afl-gcc/-clang is documented as not supporting deferred forkserver
initialization, this patch omits the definitions of __AFL_HAVE_MANUAL_CONTROL
and related macros in GCC/CLANG mode.

This restores the ability to compile a deferred-forkserver program under
afl-gcc, if it can also be compiled under gcc.

[ In case someone reads this an feels adventurous enough (as I did) to
  think about enabling deferred forkserver under afl-gcc: Whether the
  deferred forkserver actually works can be verified by placing a
  usleep(100000) or similar at the start of main (before __AFL_INIT()),
  and watching the execution speed. It doesn't work. ]
2023-04-10 13:47:19 +02:00
0782ed3841 remove pointer to removed doc 2023-04-09 10:33:39 +02:00
0eace0212e afl-cc: Avoid casts of string literals to char*, in definition of __AFL_INIT() etc.
With the right -W options, compilers may complain about the cast of
string literals (for PERSIST_SIG and DEFER_SIG) to (char*), and they're
right to do so, because string literals are constant. Since some
projects enable -Werror, this can lead to a broken build with afl-cc.

Let's simply cast to (const char *), which preserves the constness of
the string literal.
2023-04-08 17:24:02 +02:00
75d7a09469 show custom mutator name in UI 2023-04-08 13:48:07 +02:00
f9851dbfbb hopefully better -z algorithm 2023-04-08 13:00:57 +02:00
400c5e92cb renaming 2023-04-07 09:41:22 +02:00
fcb5eda5d0 nit 2023-04-05 16:34:08 +02:00
d67ee17778 fix 2023-04-05 13:30:06 +02:00
dba93705a7 better new weighting 2023-04-05 13:07:22 +02:00
36127fb197 add -z switch 2023-04-05 12:59:20 +02:00
a74561b0e7 implement switch mode 2023-04-05 12:12:05 +02:00
e313180e4d fix for clang 2023-04-05 10:32:37 +02:00
1fc0731604 stack pow 2023-04-05 09:42:27 +02:00
53b70ef104 mut changes 2023-04-05 09:33:09 +02:00
3ab18d2861 mode switch 2023-04-04 19:44:12 +02:00
fcd2125678 prepare for strategies 2023-04-04 15:47:53 +02:00
635da39bd1 preparation for mutation arrays 2023-04-03 14:41:52 +02:00