266 Commits

Author SHA1 Message Date
van Hauser
fda3106fd9
Merge pull request #2099 from Atlante45/dev
Fix dynamic_lookup linker flag for Apple clang
2024-05-24 01:33:55 +02:00
Clement Brisset
9721a77204 Fix dynamic_lookup linker flag for Apple clang 2024-05-23 11:14:53 -07:00
vanhauser-thc
31a8beb449 support new llvm 19 changes 2024-05-19 13:47:53 +02:00
vanhauser-thc
ba7ae6c59d nits 2024-05-16 14:21:00 +02:00
Arnaud Rebillout
4d4880b428 afl-cc: Re-enable i386
Was disabled in 136febaf6855ac1e04c8ea4ecbcb84eb42de2143

Closes: #2081
2024-05-11 00:48:04 +07:00
vanhauser-thc
5d623a27ed try enhanced asan support 2024-04-30 11:59:49 +02:00
vanhauser-thc
458b939bc4 LTO fix 2024-04-19 17:34:50 +02:00
vanhauser-thc
476aca5b67 nits 2024-04-19 15:45:00 +02:00
Jesse Schwartzentruber
58206a3180 Set explicit visibility on shared memory variables. 2024-04-17 14:40:41 -04:00
Sonic
50839cf6e9 afl-cc: Complete fix for afl-as
Look for afl-as, and then make sure that there's a 'as' binary in the
same directory, that seems to be either a symlink to, or a copy of,
afl-as.
2024-04-17 16:41:03 +07:00
Arnaud Rebillout
626a4434ed afl-cc: Use afl-as (rather than as) to find obj path 2024-04-17 16:40:58 +07:00
Arnaud Rebillout
d84cc73d13 afl-cc: Add missing debug statement
For each path that is tried, there's a debug log printed, _except_ for
this one. Fix it.
2024-04-17 16:40:55 +07:00
vanhauser-thc
45603367bf fix llvm modules 2024-04-07 09:44:33 +02:00
vanhauser-thc
036a79268b gcc cmplog fix 2024-02-29 09:10:29 +01:00
Sean McBride
6dc58750cf issue #2001: fix passing rpath to linker on macOS
Seems on macOS, `ld` does not want an `=` when specifying `-rpath`.
2024-02-15 19:19:51 -05:00
vanhauser-thc
88e41f01c8 env fix 2024-02-08 15:28:19 +01:00
vanhauser-thc
dc151caa18 add lto caller instrumentation 2024-02-03 15:53:54 +01:00
van Hauser
e1d7f4af35
Merge pull request #1988 from AFLplusplus/ltoctx
Ltoctx
2024-02-03 15:08:52 +01:00
vanhauser-thc
ed1a6f8a57 2024 v4.10c release 2024-02-03 11:01:31 +01:00
Khaled Yakdan
1e7485dcee
Fix type in AFL_NOOPT env variable in afl-cc help message (#1982) 2024-02-03 09:49:45 +00:00
vanhauser-thc
bd13d32437 final touches 2024-02-02 09:54:24 +01:00
vanhauser-thc
eb52f1cc08 fix ci 2024-02-01 12:58:51 +01:00
vanhauser-thc
e5d305ad42 debug ci 2024-02-01 11:43:04 +01:00
vanhauser-thc
76a033431d debug ci 2024-02-01 11:16:16 +01:00
vanhauser-thc
7793692590 debug ci 2024-02-01 10:26:16 +01:00
vanhauser-thc
97ba817aa7 debug ci 2024-02-01 09:56:31 +01:00
Sonic
643df2b538
Improve afl-cc (#1975)
* update response file support

 - full support of rsp file
 - fix some segv issues

* Improve afl-cc

 - remove dead code about allow/denylist options of sancov
 - missing `if (!aflcc->have_msan)`
 - add docs for each function
 - typo
2024-02-01 07:17:48 +00:00
Christian Holler (:decoder)
644e069450
Fixes to afl-cc and documentation (#1974)
* Always compile with -ldl when building for CODE_COVERAGE

When building with CODE_COVERAGE, the afl runtime contains code that
calls `dladdr` which requires -ldl. Under most circumstances, clang
already adds this (e.g. when building with pc-table), but there are some
circumstances where it isn't added automatically.

* Add visibility declaration to __afl_connected

When building with hidden visibility, the use of __AFL_LOOP inside such
code can cause linker errors due to __afl_connected being declared
"hidden".

* Update docs to clarify that CODE_COVERAGE=1 is required for dynamic_covfilter
2024-01-30 14:30:18 +00:00
Christian Holler (:decoder)
58b80b68bc
Dynamic instrumentation filtering for LLVM native (#1971)
* Add two dynamic instrumentation filter methods to runtime

* Always use pc-table with native pcguard

* Add make_symbol_list.py and README
2024-01-26 14:46:56 +00:00
Christian Holler (:decoder)
2f9eeef60c
Avoid adding llvmnative instrumentation when linking rust sanitizer runtime (#1969) 2024-01-26 13:41:23 +00:00
vanhauser-thc
4d493452a4 tmp 2024-01-25 17:00:53 +01:00
Sonic
d88c97ad28
Fix afl-cc (#1968)
- Check if too many cmdline params here, each time before insert a new param.
 - Check if it is "-fsanitize=..." before we do sth.
 - Remove improper param_st transfer.
2024-01-25 08:57:50 +00:00
vanhauser-thc
ba28c4982b fix 2024-01-24 18:22:17 +01:00
vanhauser-thc
8746b3e310 fix github merge fuckup 2024-01-24 18:06:02 +01:00
van Hauser
a5db79e4d6
Merge branch 'stable' into dev 2024-01-24 18:05:12 +01:00
van Hauser
d5812786f3
gcc asan workaround (#1966) 2024-01-24 16:54:57 +00:00
vanhauser-thc
ab0823cd3b apple fixes 2024-01-19 15:51:57 +01:00
vanhauser-thc
660b697ed9 typos 2024-01-19 10:28:39 +01:00
van Hauser
0c054f520e
push to stable (#1960)
* Output afl-clang-fast stuffs only if necessary (#1912)

* afl-cc header

* afl-cc common declarations

 - Add afl-cc-state.c
 - Strip includes, find_object, debug/be_quiet/have_*/callname setting from afl-cc.c
 - Use debugf_args in main
 - Modify execvp stuffs to fit new aflcc struct

* afl-cc show usage

* afl-cc mode selecting

1. compiler_mode by callname in argv[0]
2. compiler_mode by env "AFL_CC_COMPILER"
3. compiler_mode/instrument_mode by command line options "--afl-..."
4. instrument_mode/compiler_mode by various env vars including "AFL_LLVM_INSTRUMENT"
5. final checking steps
6. print "... - mode: %s-%s\n"
7. determine real argv[0] according to compiler_mode

* afl-cc macro defs

* afl-cc linking behaviors

* afl-cc fsanitize behaviors

* afl-cc misc

* afl-cc body update

* afl-cc all-in-one

formated with custom-format.py

* nits

---------

Co-authored-by: vanhauser-thc <vh@thc.org>

* changelog

* update grammar mutator

* lto llvm 12+

* docs(custom_mutators): fix missing ':' (#1953)

* Fix broken LTO mode and response file support (#1948)

* Strip `-Wl,-no-undefined` during compilation (#1952)

Make the compiler wrapper stripping `-Wl,-no-undefined` in addition to `-Wl,--no-undefined`.
Both versions of the flag are accepted by clang and, therefore, used by building systems in the wild (e.g., samba will not build without this fix).

* Remove dead code in write_to_testcase (#1955)

The custom_mutators_count check in if case is duplicate with if condition.
The else case is custom_mutators_count == 0, neither custom_mutator_list iteration nor sent check needed.

Signed-off-by: Xeonacid <h.dwwwwww@gmail.com>

* update qemuafl

* WIP: Add ability to generate drcov trace using QEMU backend (#1956)

* Document new drcov QEMU plugin

* Add link to lightkeeper for QEMU drcov file loading

---------

Co-authored-by: Jean-Romain Garnier <jean-romain.garnier@airbus.com>

* code format

* changelog

* sleep on uid != 0 afl-system-config

* fix segv about skip_next, warn on unsupported cases of linking options (#1958)

* todos

* ensure afl-cc only allows available compiler modes

* update grammar mutator

* disable aslr on apple

* fix for arm64

---------

Signed-off-by: Xeonacid <h.dwwwwww@gmail.com>
Co-authored-by: Sonic <50692172+SonicStark@users.noreply.github.com>
Co-authored-by: Xeonacid <h.dwwwwww@gmail.com>
Co-authored-by: Nils Bars <nils.bars@rub.de>
Co-authored-by: Jean-Romain Garnier <7504819+JRomainG@users.noreply.github.com>
Co-authored-by: Jean-Romain Garnier <jean-romain.garnier@airbus.com>
2024-01-18 15:17:48 +00:00
vanhauser-thc
e731a1c1ab fix for arm64 2024-01-18 12:01:26 +01:00
vanhauser-thc
136febaf68 ensure afl-cc only allows available compiler modes 2024-01-18 09:17:25 +01:00
Sonic
8412b17d79
fix segv about skip_next, warn on unsupported cases of linking options (#1958) 2024-01-18 07:56:28 +00:00
vanhauser-thc
46ef6a54e1 code format 2024-01-12 15:43:12 +01:00
Nils Bars
9d3c25ac81
Strip -Wl,-no-undefined during compilation (#1952)
Make the compiler wrapper stripping `-Wl,-no-undefined` in addition to `-Wl,--no-undefined`.
Both versions of the flag are accepted by clang and, therefore, used by building systems in the wild (e.g., samba will not build without this fix).
2024-01-11 10:45:26 +00:00
Sonic
4e9c6050d0
Fix broken LTO mode and response file support (#1948) 2024-01-11 10:44:40 +00:00
Sonic
aad9ac2b33
Output afl-clang-fast stuffs only if necessary (#1912)
* afl-cc header

* afl-cc common declarations

 - Add afl-cc-state.c
 - Strip includes, find_object, debug/be_quiet/have_*/callname setting from afl-cc.c
 - Use debugf_args in main
 - Modify execvp stuffs to fit new aflcc struct

* afl-cc show usage

* afl-cc mode selecting

1. compiler_mode by callname in argv[0]
2. compiler_mode by env "AFL_CC_COMPILER"
3. compiler_mode/instrument_mode by command line options "--afl-..."
4. instrument_mode/compiler_mode by various env vars including "AFL_LLVM_INSTRUMENT"
5. final checking steps
6. print "... - mode: %s-%s\n"
7. determine real argv[0] according to compiler_mode

* afl-cc macro defs

* afl-cc linking behaviors

* afl-cc fsanitize behaviors

* afl-cc misc

* afl-cc body update

* afl-cc all-in-one

formated with custom-format.py

* nits

---------

Co-authored-by: vanhauser-thc <vh@thc.org>
2024-01-04 13:35:25 +00:00
vanhauser-thc
98a2a334de inject docs 2023-12-27 13:58:25 +01:00
vanhauser-thc
1fc1b32db2 initial simple injection detection support 2023-12-27 13:53:11 +01:00
vanhauser-thc
520daf5e0f nit 2023-12-10 13:23:59 +01:00
vanhauser-thc
bb1d4a2491 afl-cc fixes 2023-12-07 16:15:18 +01:00