aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorvan Hauser <vh@thc.org>2022-09-16 11:51:17 +0200
committerGitHub <noreply@github.com>2022-09-16 11:51:17 +0200
commit869138aa41db5411535003fa575a35b75b857389 (patch)
tree1acbb68c44c4e3c743714cddedf4eb01066fea62 /src
parent147654f8715d237fe45c1657c87b2fe36c4db22a (diff)
parent5bf8bffd4aaedad1eef83504c46fc762e0262c27 (diff)
downloadafl++-869138aa41db5411535003fa575a35b75b857389.tar.gz
Merge pull request #1519 from AFLplusplus/dev
push to stable
Diffstat (limited to 'src')
-rw-r--r--src/afl-analyze.c4
-rw-r--r--src/afl-cc.c12
-rw-r--r--src/afl-fuzz-state.c6
-rw-r--r--src/afl-showmap.c12
4 files changed, 20 insertions, 14 deletions
diff --git a/src/afl-analyze.c b/src/afl-analyze.c
index d4822341..a21f014f 100644
--- a/src/afl-analyze.c
+++ b/src/afl-analyze.c
@@ -203,7 +203,7 @@ static void read_initial_file(void) {
/* Execute target application. Returns exec checksum, or 0 if program
times out. */
-static u32 analyze_run_target(u8 *mem, u32 len, u8 first_run) {
+static u64 analyze_run_target(u8 *mem, u32 len, u8 first_run) {
afl_fsrv_write_to_testcase(&fsrv, mem, len);
fsrv_run_result_t ret = afl_fsrv_run_target(&fsrv, exec_tmout, &stop_soon);
@@ -528,7 +528,7 @@ static void analyze() {
for (i = 0; i < in_len; i++) {
- u32 xor_ff, xor_01, sub_10, add_10;
+ u64 xor_ff, xor_01, sub_10, add_10;
u8 xff_orig, x01_orig, s10_orig, a10_orig;
/* Perform walking byte adjustments across the file. We perform four
diff --git a/src/afl-cc.c b/src/afl-cc.c
index c0449e64..5e7a9c9e 100644
--- a/src/afl-cc.c
+++ b/src/afl-cc.c
@@ -666,15 +666,21 @@ static void edit_params(u32 argc, char **argv, char **envp) {
#endif
free(ld_path);
-#if defined(AFL_CLANG_LDPATH) && LLVM_MAJOR >= 13
+#if defined(AFL_CLANG_LDPATH) && LLVM_MAJOR >= 15
+ // The NewPM implementation only works fully since LLVM 15.
+ cc_params[cc_par_cnt++] =
+ alloc_printf("-Wl,--load-pass-plugin=%s/SanitizerCoverageLTO.so", obj_path);
+#elif defined(AFL_CLANG_LDPATH) && LLVM_MAJOR >= 13
cc_params[cc_par_cnt++] = "-Wl,--lto-legacy-pass-manager";
+ cc_params[cc_par_cnt++] =
+ alloc_printf("-Wl,-mllvm=-load=%s/SanitizerCoverageLTO.so", obj_path);
#else
cc_params[cc_par_cnt++] = "-fno-experimental-new-pass-manager";
+ cc_params[cc_par_cnt++] =
+ alloc_printf("-Wl,-mllvm=-load=%s/SanitizerCoverageLTO.so", obj_path);
#endif
cc_params[cc_par_cnt++] = "-Wl,--allow-multiple-definition";
- cc_params[cc_par_cnt++] =
- alloc_printf("-Wl,-mllvm=-load=%s/SanitizerCoverageLTO.so", obj_path);
cc_params[cc_par_cnt++] = lto_flag;
} else {
diff --git a/src/afl-fuzz-state.c b/src/afl-fuzz-state.c
index 0576f84f..5199f7e6 100644
--- a/src/afl-fuzz-state.c
+++ b/src/afl-fuzz-state.c
@@ -604,11 +604,7 @@ void read_afl_environment(afl_state_t *afl, char **envp) {
}
- if (afl->afl_env.afl_pizza_mode) {
-
- afl->pizza_is_served = 1;
-
- }
+ if (afl->afl_env.afl_pizza_mode) { afl->pizza_is_served = 1; }
if (issue_detected) { sleep(2); }
diff --git a/src/afl-showmap.c b/src/afl-showmap.c
index 07f30326..b0b21011 100644
--- a/src/afl-showmap.c
+++ b/src/afl-showmap.c
@@ -1241,11 +1241,15 @@ int main(int argc, char **argv_orig, char **envp) {
u32 save_be_quiet = be_quiet;
be_quiet = !debug;
if (map_size > 4194304) {
- fsrv->map_size = map_size;
- }
- else {
- fsrv->map_size = 4194304; // dummy temporary value
+
+ fsrv->map_size = map_size;
+
+ } else {
+
+ fsrv->map_size = 4194304; // dummy temporary value
+
}
+
u32 new_map_size =
afl_fsrv_get_mapsize(fsrv, use_argv, &stop_soon,
(get_afl_env("AFL_DEBUG_CHILD") ||