diff --git a/Makefile b/Makefile index ab70e9cb5c5fb41efa272573d3dabda0c7f75c72..51aa2c3e1a263c574c32f68397123d7ce9260dff 100644 --- a/Makefile +++ b/Makefile @@ -310,7 +310,7 @@ all_done: test_build .NOTPARALLEL: clean clean: - rm -f $(PROGS) libradamsa.so afl-as as afl-g++ afl-clang afl-clang++ *.o src/*.o *~ a.out core core.[1-9][0-9]* *.stackdump .test .test1 .test2 test-instr .test-instr0 .test-instr1 qemu_mode/qemu-3.1.1.tar.xz afl-qemu-trace afl-gcc-fast afl-gcc-pass.so afl-gcc-rt.o afl-g++-fast *.so *.8 + rm -f $(PROGS) libradamsa.so afl-fuzz-document afl-as as afl-g++ afl-clang afl-clang++ *.o src/*.o *~ a.out core core.[1-9][0-9]* *.stackdump .test .test1 .test2 test-instr .test-instr0 .test-instr1 qemu_mode/qemu-3.1.1.tar.xz afl-qemu-trace afl-gcc-fast afl-gcc-pass.so afl-gcc-rt.o afl-g++-fast *.so *.8 rm -rf out_dir qemu_mode/qemu-3.1.1 *.dSYM */*.dSYM -$(MAKE) -C llvm_mode clean -$(MAKE) -C gcc_plugin clean diff --git a/README.md b/README.md index 09df08c63ef81391a8b71b2bc3362fc2cf1e4969..bb98357e010b4a110cf69609f08001d1981eea8d 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,9 @@  - Release Version: 2.58c + Release Version: 2.59c - Github Version: 2.58d + Github Version: 2.59d includes all necessary/interesting changes from Google's afl 2.56b diff --git a/docs/ChangeLog b/docs/ChangeLog index 408c5692f876a7e5aa94450067a51b803ef62863..5132a1c1bb1b87b3577918123b8cf975e892d27b 100644 --- a/docs/ChangeLog +++ b/docs/ChangeLog @@ -13,9 +13,9 @@ Want to stay in the loop on major new features? Join our mailing list by sending a mail to <afl-users+subscribe@googlegroups.com>. ----------------------- -Version ++2.58d (dev): ----------------------- +-------------------------- +Version ++2.59c (release): +-------------------------- - qbdi_mode: fuzz android native libraries via QBDI framework - unicorn_mode: switched to the new unicornafl, thanks domenukk diff --git a/include/config.h b/include/config.h index 29bdf048006044aa85ca756c0eae9a6dec6dc0f6..4bb2fe4b451fa6f5037a003b9ec3057f151df520 100644 --- a/include/config.h +++ b/include/config.h @@ -26,7 +26,7 @@ /* Version string: */ -#define VERSION "++2.58d" // c = release, d = volatile github dev +#define VERSION "++2.59c" // c = release, d = volatile github dev /****************************************************** * * diff --git a/libdislocator/libdislocator.so.c b/libdislocator/libdislocator.so.c index 33985ce9b89ce687b363701b322ccf899b7b1c8c..0eb3f628f37f15b8f72dda1e4e516df95e923290 100644 --- a/libdislocator/libdislocator.so.c +++ b/libdislocator/libdislocator.so.c @@ -130,7 +130,7 @@ static u8 alloc_verbose, /* Additional debug messages */ static __thread size_t total_mem; /* Currently allocated mem */ static __thread u32 call_depth; /* To avoid recursion via fprintf() */ -static u32 alloc_canary; +static u32 alloc_canary; /* This is the main alloc function. It allocates one page more than necessary, sets that tailing page to PROT_NONE, and then increments the return address @@ -348,10 +348,10 @@ int posix_memalign(void** ptr, size_t align, size_t len) { return 0; } - + size_t rem = len % align; if (rem) len += align - rem; - + *ptr = __dislocator_alloc(len); if (*ptr && len) memset(*ptr, ALLOC_CLOBBER, len); diff --git a/llvm_mode/afl-clang-fast.c b/llvm_mode/afl-clang-fast.c index c2b54a513585deb8cb2c1e51b7ab8e8c394d0d8d..a262e998d05f6ceaca222e5f6673ab7e9c7727bd 100644 --- a/llvm_mode/afl-clang-fast.c +++ b/llvm_mode/afl-clang-fast.c @@ -358,7 +358,7 @@ static void edit_params(u32 argc, char** argv) { } -//#ifndef __ANDROID__ // not sure, we might need these ifdefs for Android + //#ifndef __ANDROID__ // not sure, we might need these ifdefs for Android switch (bit_mode) { case 0: @@ -382,7 +382,8 @@ static void edit_params(u32 argc, char** argv) { break; } -//#endif + + //#endif } @@ -443,9 +444,10 @@ int main(int argc, char** argv) { } -//#ifndef __ANDROID__ // not sure this is needed for Android, so at the moment we rather keep this out + //#ifndef __ANDROID__ // not sure this is needed for Android, so at the moment + //we rather keep this out find_obj(argv[0]); -//#endif + //#endif edit_params(argc, argv); diff --git a/qemu_mode/build_qemu_support.sh b/qemu_mode/build_qemu_support.sh index c3983aa17ca00dda3cb2df2bb2daace9b100f4c5..afd82f72329ec8d1d3369f49e0a8f4434d25259c 100755 --- a/qemu_mode/build_qemu_support.sh +++ b/qemu_mode/build_qemu_support.sh @@ -243,10 +243,9 @@ else fi echo "[+] Building libcompcov ..." -make -C libcompcov +make -C libcompcov && echo "[+] libcompcov ready" echo "[+] Building unsigaction ..." -make -C unsigaction -echo "[+] libcompcov ready" +make -C unsigaction && echo "[+] unsigaction ready" echo "[+] All done for qemu_mode, enjoy!" exit 0 diff --git a/qemu_mode/patches/afl-qemu-common.h b/qemu_mode/patches/afl-qemu-common.h index 2c1939aa8aed20a242f0d47c4448f382a5c0b152..bddf0515d881b4a4ab6fa407e31e7448b9d79677 100644 --- a/qemu_mode/patches/afl-qemu-common.h +++ b/qemu_mode/patches/afl-qemu-common.h @@ -79,8 +79,8 @@ void afl_debug_dump_saved_regs(); void afl_persistent_loop(); void tcg_gen_afl_call0(void *func); -void tcg_gen_afl_compcov_log_call(void *func, target_ulong cur_loc, - TCGv arg1, TCGv arg2); +void tcg_gen_afl_compcov_log_call(void *func, target_ulong cur_loc, TCGv arg1, + TCGv arg2); void tcg_gen_afl_maybe_log_call(target_ulong cur_loc); diff --git a/qemu_mode/patches/afl-qemu-tcg-inl.h b/qemu_mode/patches/afl-qemu-tcg-inl.h index 33e0d2a76d73fead13a09d628bb3880711a63889..8ac993a28ce4be35b0549f57868209765baf69f5 100644 --- a/qemu_mode/patches/afl-qemu-tcg-inl.h +++ b/qemu_mode/patches/afl-qemu-tcg-inl.h @@ -376,8 +376,8 @@ void tcg_gen_afl_call0(void *func) { } -void tcg_gen_afl_compcov_log_call(void *func, target_ulong cur_loc, - TCGv arg1, TCGv arg2) { +void tcg_gen_afl_compcov_log_call(void *func, target_ulong cur_loc, TCGv arg1, + TCGv arg2) { int i, real_args, nb_rets, pi; unsigned sizemask, flags; diff --git a/src/afl-fuzz-bitmap.c b/src/afl-fuzz-bitmap.c index 8f00611cf07817075430f90c344e26600c6cc431..c1aeb9ac180153b99ddc8c06cea658734977e377 100644 --- a/src/afl-fuzz-bitmap.c +++ b/src/afl-fuzz-bitmap.c @@ -685,13 +685,14 @@ u8 save_if_interesting(char** argv, void* mem, u32 len, u8 fault) { ++unique_crashes; if (infoexec) { // if the user wants to be informed on new crashes - do #if !TARGET_OS_IPHONE - // that + // that if (system(infoexec) == -1) hnb += 0; // we dont care if system errors, but we dont want a // compiler warning either #else WARNF("command execution unsupported"); #endif + } last_crash_time = get_cur_time(); diff --git a/src/afl-fuzz-init.c b/src/afl-fuzz-init.c index c91b7bb7de6951bcfc57a0b942f018c66a46c041..825169cf8f98fcb49661aedc7fda8ac18690f658 100644 --- a/src/afl-fuzz-init.c +++ b/src/afl-fuzz-init.c @@ -1905,9 +1905,10 @@ void check_binary(u8* fname) { #else #if !defined(__arm__) && !defined(__arm64__) - if ((f_data[0] != 0xCF || f_data[1] != 0xFA || f_data[2] != 0xED) - && (f_data[0] != 0xCA || f_data[1] != 0xFE || f_data[2] != 0xBA)) - FATAL("Program '%s' is not a 64-bit or universal Mach-O binary", target_path); + if ((f_data[0] != 0xCF || f_data[1] != 0xFA || f_data[2] != 0xED) && + (f_data[0] != 0xCA || f_data[1] != 0xFE || f_data[2] != 0xBA)) + FATAL("Program '%s' is not a 64-bit or universal Mach-O binary", + target_path); #endif #endif /* ^!__APPLE__ */ diff --git a/unicorn_mode/build_unicorn_support.sh b/unicorn_mode/build_unicorn_support.sh index 707e47bb910f911d3ecb090c6c784297238ae66c..e79e0b51d7fc15e81e96d021190675a3ec1cd5f0 100755 --- a/unicorn_mode/build_unicorn_support.sh +++ b/unicorn_mode/build_unicorn_support.sh @@ -124,8 +124,9 @@ fi echo "[+] All checks passed!" echo "[*] Making sure unicornafl is checked out" -git submodule init || exit 1 -git submodule update || exit 1 +test -d unicorn && { cd unicorn && { git stash ; git pull ; cd .. ; } } +test -d unicorn || git clone https://github.com/vanhauser-thc/unicorn +test -d unicorn || { echo "[-] not checked out, please install git or check your internet connection." ; exit 1 ; } echo "[+] Got unicornafl." echo "[*] making sure config.h matches"