6452 Commits

Author SHA1 Message Date
vanhauser-thc
824385f52c make llvm 17 work 2023-04-12 14:03:29 +02:00
vanhauser-thc
d304f4e4f1 update lto doc 2023-04-12 11:24:56 +02:00
van Hauser
4f2d9eeaaa
Merge pull request #1700 from AFLplusplus/dev
push to stable
2023-04-12 10:54:08 +02:00
vanhauser-thc
743ae50775 nits 2023-04-12 10:53:23 +02:00
van Hauser
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
van Hauser
1589e17213
Merge pull request #1697 from devnexen/llvm_instr_warning_fix
LLVM instrumentation disable build warning.
2023-04-10 14:35:56 +02:00
Jonathan Neuschäfer
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
David CARLIER
a0818c4fce LLVM instrumentation disable build warning.
Since clang 16 is the version for Ubuntu 23 04/Fedora 38 and is easy enough to fix..
2023-04-10 12:38:26 +01:00
vanhauser-thc
0782ed3841 remove pointer to removed doc 2023-04-09 10:33:39 +02:00
van Hauser
0911525194
Merge pull request #1694 from neuschaefer/dev
afl-cc: Avoid casts of string literals to char*, in definition of __AFL_INIT() etc.
2023-04-08 17:33:41 +02:00
Jonathan Neuschäfer
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
vanhauser-thc
c1af004451 afl-whatsup tput 2023-04-08 15:29:43 +02:00
van Hauser
abd6b06fa4
Merge pull request #1693 from hardik05/patch-1
display instance name
2023-04-08 14:42:08 +02:00
Hardik Shah
35151cefe8
display instance name 2023-04-08 17:57:08 +05:30
vanhauser-thc
75d7a09469 show custom mutator name in UI 2023-04-08 13:48:07 +02:00
vanhauser-thc
f9851dbfbb hopefully better -z algorithm 2023-04-08 13:00:57 +02:00
vanhauser-thc
400c5e92cb renaming 2023-04-07 09:41:22 +02:00
vanhauser-thc
fcb5eda5d0 nit 2023-04-05 16:34:08 +02:00
vanhauser-thc
d67ee17778 fix 2023-04-05 13:30:06 +02:00
vanhauser-thc
dba93705a7 better new weighting 2023-04-05 13:07:22 +02:00
vanhauser-thc
36127fb197 add -z switch 2023-04-05 12:59:20 +02:00
vanhauser-thc
a74561b0e7 implement switch mode 2023-04-05 12:12:05 +02:00
vanhauser-thc
e313180e4d fix for clang 2023-04-05 10:32:37 +02:00
vanhauser-thc
1fc0731604 stack pow 2023-04-05 09:42:27 +02:00
vanhauser-thc
53b70ef104 mut changes 2023-04-05 09:33:09 +02:00
vanhauser-thc
41a452d4e8 mutation lists 2023-04-04 21:48:51 +02:00
vanhauser-thc
3ab18d2861 mode switch 2023-04-04 19:44:12 +02:00
vanhauser-thc
2bff92c603 nit 2023-04-04 16:25:05 +02:00
vanhauser-thc
32ffa2664c max_len support 2023-04-04 16:23:19 +02:00
vanhauser-thc
fcd2125678 prepare for strategies 2023-04-04 15:47:53 +02:00
vanhauser-thc
635da39bd1 preparation for mutation arrays 2023-04-03 14:41:52 +02:00
van Hauser
5fea071ae9
Merge pull request #1692 from nj00001/dev
fix getOperand out of range
2023-04-03 10:33:59 +02:00
nj00001
a01138e1c8
fix getOperand out of range
This commit fixes a sloppy function call that should normally check the number of insn's Operand before calling insn's getOperand method. The fix is that if it is 0 it should continue the loop.
I solved problem https://github.com/AFLplusplus/AFLplusplus/issues/1688#issue-1648543691 using this modification
2023-04-03 15:32:52 +08:00
vanhauser-thc
71e2aa5d2b more fix 2023-04-02 13:42:08 +02:00
vanhauser-thc
21203c2ea6 fix 2023-04-02 12:39:02 +02:00
vanhauser-thc
319b2e8e6f fix ui layout with slow targets in pizza mode 2023-04-02 12:08:54 +02:00
vanhauser-thc
e46e0bce44 allow pizza mode to be disabled 2023-04-02 12:03:45 +02:00
vanhauser-thc
4d02d8e43d fix buffer overflow in pizza mode :( 2023-04-02 11:52:36 +02:00
vanhauser-thc
be96253f52 nits 2023-03-31 11:02:27 +02:00
vanhauser-thc
9eed60d105 nit 2023-03-31 08:12:32 +02:00
vanhauser-thc
8f17c81691 less mutation 2023-03-30 22:41:02 +02:00
vanhauser-thc
74baebd93e fix 2023-03-30 20:02:59 +02:00
vanhauser-thc
506f6b1349 nits 2023-03-30 19:28:59 +02:00
vanhauser-thc
2d0d1e267e better aflpp driver 2023-03-30 14:07:33 +02:00
vanhauser-thc
145748a7e0 prepare new mutation strategies 2023-03-30 14:00:45 +02:00
vanhauser-thc
a061e1304d further magma adaption 2023-03-30 10:18:45 +02:00
vanhauser-thc
7893347e13 final touches 2023-03-29 22:56:12 +02:00
vanhauser-thc
5218c0b187 all mutation strategies 2023-03-29 22:53:15 +02:00
vanhauser-thc
dbdf2d79f2 magma support 2023-03-29 10:57:57 +02:00
vanhauser-thc
48816417ee introspection 2023-03-29 10:13:18 +02:00