fix frida, fix dictionary generation to honor AFL_LLVM_{ALLOW/DENY}LIST
MODIFY
docs/Changelog.md
docs/Changelog.md
@@ -24,10 +24,12 @@ sending a mail to <afl-users+subscribe@googlegroups.com>.
- Fix to instrument global namespace functions in c++
- Fix for llvm 13
- support partial linking
+ - do honor AFL_LLVM_{ALLOW/DENY}LIST for LTO autodictionary and DICT2FILE
- We do support llvm versions from 3.8 to 5.0 again
- frida_mode:
- several fixes for cmplog
- remove need for AFL_FRIDA_PERSISTENT_RETADDR_OFFSET
+ - less coverage collision
- feature parity of aarch64 with intel now (persistent, cmplog,
in-memory testcases, asan)
- afl-cmin and afl-showmap -i do now descend into subdirectories

MODIFY
frida_mode/src/instrument/instrument.c
frida_mode/src/instrument/instrument.c
#include <unistd.h>
#include <sys/shm.h>
#include <sys/mman.h>
+#include <sys/syscall.h>
#include "frida-gumjs.h"
@@ -289,7 +290,7 @@ void instrument_init(void) {
* needs to be different for each instance.
*/
instrument_hash_seed =
- g_get_monotonic_time() ^ (((guint64)getpid()) << 32) ^ gettid();
+ g_get_monotonic_time() ^ (((guint64)getpid()) << 32) ^ syscall(SYS_gettid);
OKF("Instrumentation - seed [0x%016" G_GINT64_MODIFIER "x]",
instrument_hash_seed);

MODIFY
instrumentation/SanitizerCoverageLTO.so.cc
instrumentation/SanitizerCoverageLTO.so.cc
@@ -516,6 +516,8 @@ bool ModuleSanitizerCoverage::instrumentModule(
for (auto &F : M) {
+ if (!isInInstrumentList(&F) || !F.size()) { continue; }
+
for (auto &BB : F) {
for (auto &IN : BB) {

MODIFY
instrumentation/afl-llvm-dict2file.so.cc
instrumentation/afl-llvm-dict2file.so.cc
@@ -154,6 +154,7 @@ bool AFLdict2filePass::runOnModule(Module &M) {
for (auto &F : M) {
if (isIgnoreFunction(&F)) continue;
+ if (!isInInstrumentList(&F) || !F.size()) { continue; }
/* Some implementation notes.
*

MODIFY
instrumentation/afl-llvm-pass.so.cc
instrumentation/afl-llvm-pass.so.cc
@@ -438,9 +438,9 @@ bool AFLCoverage::runOnModule(Module &M) {
fprintf(stderr, "FUNCTION: %s (%zu)\n", F.getName().str().c_str(),
F.size());
- if (!isInInstrumentList(&F)) continue;
+ if (!isInInstrumentList(&F)) { continue; }
- if (F.size() < function_minimum_size) continue;
+ if (F.size() < function_minimum_size) { continue; }
std::list<Value *> todo;
for (auto &BB : F) {

fix frida, fix dictionary generation to honor AFL_LLVM_{ALLOW/DENY}LIST