diff options
author | van Hauser <vh@thc.org> | 2024-10-07 16:46:12 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-07 16:46:12 +0200 |
commit | 78b7e14c73baacf1d88b3c03955e78f5080d17ba (patch) | |
tree | 402d065bc2fed732f8a08c5b3b7f283c6952973d | |
parent | c1e40c5fb7de40dc5f598c609c907ea21e5a078a (diff) | |
parent | f9a8b60b3b3eb508234e2303c208acdccc50333e (diff) | |
download | afl++-78b7e14c73baacf1d88b3c03955e78f5080d17ba.tar.gz |
Merge pull request #2222 from AFLplusplus/dev
push to stable
-rw-r--r-- | include/forkserver.h | 1 | ||||
-rw-r--r-- | utils/aflpp_driver/aflpp_driver.c | 9 | ||||
-rw-r--r-- | utils/libdislocator/libdislocator.so.c | 3 |
3 files changed, 8 insertions, 5 deletions
diff --git a/include/forkserver.h b/include/forkserver.h index db1832c4..d3d0e086 100644 --- a/include/forkserver.h +++ b/include/forkserver.h @@ -249,7 +249,6 @@ void afl_fsrv_kill(afl_forkserver_t *fsrv); void nyx_load_target_hash(afl_forkserver_t *fsrv); #endif - #ifdef __APPLE__ #define MSG_FORK_ON_APPLE \ " - On MacOS X, the semantics of fork() syscalls are non-standard and " \ diff --git a/utils/aflpp_driver/aflpp_driver.c b/utils/aflpp_driver/aflpp_driver.c index 6e992266..9b79ef9b 100644 --- a/utils/aflpp_driver/aflpp_driver.c +++ b/utils/aflpp_driver/aflpp_driver.c @@ -400,7 +400,7 @@ __attribute__((weak)) int LLVMFuzzerRunDriver( size_t prev_length = 0; // for speed only insert asan functions if the target is linked with asan - if (__asan_region_is_poisoned) { + if (unlikely(__asan_region_is_poisoned)) { while (__afl_persistent_loop(N)) { @@ -437,7 +437,12 @@ __attribute__((weak)) int LLVMFuzzerRunDriver( while (__afl_persistent_loop(N)) { - callback(__afl_fuzz_ptr, *__afl_fuzz_len); + if (unlikely(callback(__afl_fuzz_ptr, *__afl_fuzz_len) == -1)) { + + memset(__afl_area_ptr, 0, __afl_map_size); + __afl_area_ptr[0] = 1; + + } } diff --git a/utils/libdislocator/libdislocator.so.c b/utils/libdislocator/libdislocator.so.c index f41491b1..b125f628 100644 --- a/utils/libdislocator/libdislocator.so.c +++ b/utils/libdislocator/libdislocator.so.c @@ -580,11 +580,10 @@ __attribute__((constructor)) void __dislocator_init(void) { __attribute__((destructor)) void __dislocator_fini(void) { - alloc_canary = ALLOC_CANARY; // restore to default canary value + alloc_canary = ALLOC_CANARY; // restore to default canary value } - /* NetBSD fault handler specific api subset */ void (*esetfunc(void (*fn)(int, const char *, ...)))(int, const char *, ...) { |