186 Commits

Author SHA1 Message Date
vanhauser-thc
69a596c089 ensure this does not happen again 2024-07-14 10:20:53 +02:00
vanhauser-thc
ccb952dde8 Revert "Replace gettimeofday with clock_gettime (#2159)"
This reverts commit 7c380a6612f00e4a7ed02364dc2b3769e8edc8f8.
2024-07-14 10:18:23 +02:00
carpintero-de-c
7c380a6612
Replace gettimeofday with clock_gettime (#2159) 2024-07-14 00:25:58 +02:00
vanhauser-thc
e7da8b9d6b Revert "MONOTONIC"
This reverts commit 0c9b460cc46aebfa4eb6e1fbe928895c0a8fcfbd.
2024-06-13 09:19:11 +02:00
vanhauser-thc
0c9b460cc4 MONOTONIC 2024-06-12 09:17:07 +02:00
vanhauser-thc
74e264a20a move function 2024-06-07 13:46:15 +02:00
vanhauser-thc
f0937f96d4 target hash 2024-06-07 11:48:58 +02:00
vanhauser-thc
894339c5d7 try regression fix 2024-06-01 12:26:26 +02:00
vanhauser-thc
9419e39fdf nits 2024-05-31 18:32:31 +02:00
vanhauser-thc
5d623a27ed try enhanced asan support 2024-04-30 11:59:49 +02:00
vanhauser-thc
476aca5b67 nits 2024-04-19 15:45:00 +02:00
vanhauser-thc
29544e4d2b fix time 2024-04-07 18:44:21 +02:00
vanhauser-thc
420a90ff75 code format 2024-04-07 12:53:41 +02:00
Sergey Bronnikov
5ffc8c7076 src: fix calculation of fuzzing time in statistics
When the computer is suspended during a fuzzing session,
the time spent in suspended state is counted as a "run time"
on a statistics screen.

The time returned by `gettimeofday(2)` is affected by discontinuous
jumps in the system time. It is better using `clock_gettime(2)`.

The patch replace `gettimeofday` with `clock_gettime` [1].
`clock_gettime` uses a CLOCK_MONOTONIC_COARSE clock type,
it is faster than CLOCK_MONOTONIC, but still has resolution (~1ms)
that is adequate for our purposes. However, CLOCK_MONOTONIC_COARSE
is a Linux-specific clock variant, so on macOS it is replaced
with CLOCK_MONOTONIC, and with CLOCK_MONOTONIC_FAST on FreeBSD [2].

Closes #1241

1. https://pubs.opengroup.org/onlinepubs/9699919799/functions/clock_gettime.html
2. https://man.freebsd.org/cgi/man.cgi?query=clock_gettime
2024-03-31 11:11:29 +03:00
van Hauser
602eceed8b
push to stable (#1983)
* 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

* help selective instrumentation

* typos

* macos

* add compiler test script

* apple fixes

* bump nyx submodules (#1963)

* fix docs

* update changelog

* update grammar mutator

* improve compiler test script

* gcc asan workaround (#1966)

* fix github merge fuckup

* fix

* 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.

* Avoid adding llvmnative instrumentation when linking rust sanitizer runtime (#1969)

* 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

* changelog

* todos

* new forkserver check

* fix

* nyx test for CI

* improve nyx docs

* 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

* nits

* nyx build script updates

* test error output

* debug ci

* debug ci

* 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

* enable nyx

* debug ci

* debug ci

* debug ci

* debug ci

* debug ci

* debug ci

* debug ci

* debug ci

* fix ci

* clean test script

* NO_NYX

* NO_NYX

* fix ci

* debug ci

* fix ci

* finalize ci fix

* Enhancement on Deterministic stage (#1972)

* fuzzer: init commit based on aflpp 60dc37a8cf09f8e9048e4b6a2204d6c90b27655a

* fuzzers: adding the skip variables and initialize

* log: profile the det/havoc finding

* log: add profile log output

* fuzzers: sperate log/skipdet module

* fuzzers: add quick eff_map calc

* fuzzers: add skip_eff_map in fuzz_one

* fuzzers: mark whole input space in eff_map

* fuzzers: add undet bit threshold to skip some seeds

* fuzzers: fix one byte overflow

* fuzzers: fix overflow

* fix code format

* add havoc only again

* code format

* remove log to INTROSPECTION, rename skipdet module

* rename skipdet module

* remove log to stats

* clean redundant code

* code format

* remove redundant code format check

* remove redundant doc

* remove redundant objects

* clean files

* change -d to default skipdet

* disable deterministic when using CUSTOM_MUTATOR

* revert fix

* final touches for skipdet

* remove unused var

* remove redundant eff struct (#1977)

* update QEMU-Nyx submodule (#1978)

* update QEMU-Nyx submodule (#1980)

* Fix type in AFL_NOOPT env variable in afl-cc help message (#1982)

* nits

* 2024 v4.10c release

* fixes

---------

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>
Co-authored-by: Sergej Schumilo <sergej@schumilo.de>
Co-authored-by: Christian Holler (:decoder) <choller@mozilla.com>
Co-authored-by: Han Zheng <35988108+kdsjZh@users.noreply.github.com>
Co-authored-by: Khaled Yakdan <yakdan@code-intelligence.com>
2024-02-03 10:55:51 +00:00
vanhauser-thc
053334f35d fix lsan fix 2023-11-06 10:02:53 +01:00
hexcoder-
6ed3f4cfac fix of fix: make sure ASAN_OPTIONS and LSAN_OPTIONS agree on leak detection 2023-11-04 22:48:27 +01:00
hexcoder
8338844284
copy 'detect_leaks=0' from ASAN to LSAN
fix for issue #1733, set "detect_leaks=0" when ASAN_OPTIONS contains it and LSAN_OPTIONS are not set.
2023-11-04 22:01:09 +01:00
hexcoder
1132b08d7d
Update afl-common.c typo 2023-07-13 13:37:47 +02:00
vanhauser-thc
a46d27fad5 nits 2023-07-10 18:29:21 +02:00
vanhauser-thc
d518426335 no_ui: display time 2023-07-02 14:50:18 +02:00
vanhauser-thc
401d7617ef symqemu mutator options 2023-05-18 10:50:10 +02:00
vanhauser-thc
56f7e3aa08 hidden -Y option for nyx, code format 2023-04-16 12:42:32 +02:00
Sergej Schumilo
61aeb44863 remove redundant access() call 2023-04-16 05:19:09 +02:00
Sergej Schumilo
47833bcf9e fix remove_nyx_tmp_workdir function 2023-04-16 04:28:19 +02:00
Sergej Schumilo
eefd98f374 add Nyx support in various tools (like afl-cmin) 2023-04-14 02:25:33 +02:00
vanhauser-thc
5221938945 various fixes 2023-03-09 17:36:13 +01:00
vanhauser-thc
dc7ef967d8 fix attempt at lsan 2023-03-09 14:56:38 +01:00
vanhauser-thc
f4a13585a1 better asan defaults everwhere 2023-01-26 12:21:47 +01:00
vanhauser-thc
35f09e11a4 welcome 2023 2023-01-03 09:38:07 +01:00
vanhauser-thc
0b6007a49c fix fork server kill signals for qemu, unicorn and nyx mode 2022-10-29 10:00:36 +02:00
vanhauser-thc
05e0825d66 changelog update 2022-10-24 20:06:57 +02:00
Nils Bars
102b749c07 AFL_FORK_SERVER_KILL_SIGNAL backwards compatiblity
If `AFL_KILL_SIGNAL` is set, `AFL_FORK_SERVER_KILL_SIGNAL` is set
to the same value.
2022-10-24 17:54:03 +02:00
Nils Bars
7512316b46 Add AFL_FORK_SERVER_KILL_SIGNAL environment variable.
The AFL_FORK_SERVER_KILL_SIGNAL variable allows to configure the signal
used to kill the fork server on termination.
2022-10-21 12:47:00 +02:00
vanhauser-thc
b847e0f414 clang format 14 2022-07-12 09:04:54 +02:00
vanhauser-thc
1a4c0d2ecd nits 2022-06-20 17:59:14 +02:00
Ruben ten Hove
0c3ba7d227 clarity 2022-06-18 07:23:06 -04:00
Ruben ten Hove
bf6a0159a9 formatting 2022-06-18 02:37:11 +02:00
Ruben ten Hove
0dd1c39b5a check for empty env var as well 2022-06-18 02:35:31 +02:00
fuzzah
c2ae24ab96 fix early return in AFL_TARGET_ENV 2022-03-21 22:58:17 +03:00
vanhauser-thc
cf853fb249 reintroduce AFL_PERSISTENT and AFL_DEFER_FORKSRV 2022-02-08 20:15:48 +01:00
vanhauser-thc
04d693721b force persistent and deferred also for tools 2022-02-05 07:25:12 +01:00
vanhauser-thc
e1082f2548 welcome 2022 2022-01-01 00:49:17 +01:00
vanhauser-thc
47488dcd02 nits 2021-12-25 14:21:59 +01:00
Akira Moroo
9100f3c416 Add initial CoreSight mode support
The original code is:
https://github.com/RICSecLab/AFLplusplus-cs/tree/retrage/coresight-mode-pr

Signed-off-by: Akira Moroo <retrage01@gmail.com>
2021-11-11 09:52:21 +00:00
vanhauser-thc
9325a4fcbb http->https 2021-11-06 10:28:22 +01:00
yuan
3670412d2e
Fix request size & remove redundant code (#1139)
* fix request size

* fix null terminator index

* remove redundant code
2021-11-03 16:44:37 +01:00
vanhauser-thc
f760e80729 add check_binary_signatures for afl-* utils 2021-09-07 17:16:23 +02:00
vanhauser-thc
63504f7b7e fix cmplog screen update crash 2021-06-11 10:44:06 +02:00
vanhauser-thc
07c3e47e6b fixes 2021-06-01 11:19:49 +02:00