mirror of
https://github.com/AFLplusplus/AFLplusplus.git
synced 2025-06-12 10:08:07 +00:00
android: prefer bigcores
This commit is contained in:
@ -21,10 +21,12 @@ Version ++2.60d (develop):
|
|||||||
- afl-fuzz:
|
- afl-fuzz:
|
||||||
- now prints the real python version support compiled in
|
- now prints the real python version support compiled in
|
||||||
- set stronger performance compile options and little tweaks
|
- set stronger performance compile options and little tweaks
|
||||||
|
- Android: prefer bigcores when selecting a CPU
|
||||||
- afl-clang-fast:
|
- afl-clang-fast:
|
||||||
- show in the help output for which llvm version it was compiled for
|
- show in the help output for which llvm version it was compiled for
|
||||||
- now does not need to be recompiled between trace-pc and pass
|
- now does not need to be recompiled between trace-pc and pass
|
||||||
instrumentation. compile normally and set AFL_LLVM_USE_TRACE_PC :)
|
instrumentation. compile normally and set AFL_LLVM_USE_TRACE_PC :)
|
||||||
|
- llvm 11 is supported
|
||||||
- afl-cmin is now a sh script (invoking awk) instead of bash for portability
|
- afl-cmin is now a sh script (invoking awk) instead of bash for portability
|
||||||
the original script is still present as afl-cmin.bash
|
the original script is still present as afl-cmin.bash
|
||||||
- added blacklist and whitelisting function check in all modules of llvm_mode
|
- added blacklist and whitelisting function check in all modules of llvm_mode
|
||||||
|
@ -190,7 +190,8 @@ struct InsTrim : public ModulePass {
|
|||||||
|
|
||||||
if (instFilename.str().empty()) {
|
if (instFilename.str().empty()) {
|
||||||
|
|
||||||
/* If the original location is empty, try using the inlined location */
|
/* If the original location is empty, try using the inlined location
|
||||||
|
*/
|
||||||
DILocation *oDILoc = cDILoc->getInlinedAt();
|
DILocation *oDILoc = cDILoc->getInlinedAt();
|
||||||
if (oDILoc) {
|
if (oDILoc) {
|
||||||
|
|
||||||
@ -424,8 +425,8 @@ struct InsTrim : public ModulePass {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
OKF("Instrumented %u locations (%llu, %llu) (%s mode)\n",
|
OKF("Instrumented %u locations (%llu, %llu) (%s mode)\n", total_instr,
|
||||||
total_instr, total_rs, total_hs,
|
total_rs, total_hs,
|
||||||
getenv("AFL_HARDEN")
|
getenv("AFL_HARDEN")
|
||||||
? "hardened"
|
? "hardened"
|
||||||
: ((getenv("AFL_USE_ASAN") || getenv("AFL_USE_MSAN"))
|
: ((getenv("AFL_USE_ASAN") || getenv("AFL_USE_MSAN"))
|
||||||
|
@ -184,11 +184,21 @@ void bind_to_free_cpu(void) {
|
|||||||
"For this platform we do not have free CPU binding code yet. If possible, please supply a PR to https://github.com/vanhauser-thc/AFLplusplus"
|
"For this platform we do not have free CPU binding code yet. If possible, please supply a PR to https://github.com/vanhauser-thc/AFLplusplus"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
for (i = 0; i < cpu_core_count; ++i)
|
size_t cpu_start = 0;
|
||||||
if (!cpu_used[i]) break;
|
|
||||||
|
|
||||||
|
try:
|
||||||
|
#ifndef __ANDROID__
|
||||||
|
for (i = cpu_start; i < cpu_core_count; i++)
|
||||||
|
if (!cpu_used[i]) break;
|
||||||
if (i == cpu_core_count) {
|
if (i == cpu_core_count) {
|
||||||
|
|
||||||
|
#else
|
||||||
|
for (i = cpu_core_count - cpu_start - 1; i > -1; i--)
|
||||||
|
if (!cpu_used[i]) break;
|
||||||
|
if (i == -1) {
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
SAYF("\n" cLRD "[-] " cRST
|
SAYF("\n" cLRD "[-] " cRST
|
||||||
"Uh-oh, looks like all %d CPU cores on your system are allocated to\n"
|
"Uh-oh, looks like all %d CPU cores on your system are allocated to\n"
|
||||||
" other instances of afl-fuzz (or similar CPU-locked tasks). "
|
" other instances of afl-fuzz (or similar CPU-locked tasks). "
|
||||||
@ -197,12 +207,11 @@ void bind_to_free_cpu(void) {
|
|||||||
"you are\n"
|
"you are\n"
|
||||||
" absolutely sure, you can set AFL_NO_AFFINITY and try again.\n",
|
" absolutely sure, you can set AFL_NO_AFFINITY and try again.\n",
|
||||||
cpu_core_count);
|
cpu_core_count);
|
||||||
|
|
||||||
FATAL("No more free CPU cores");
|
FATAL("No more free CPU cores");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
OKF("Found a free CPU core, binding to #%u.", i);
|
OKF("Found a free CPU core, try binding to #%u.", i);
|
||||||
|
|
||||||
cpu_aff = i;
|
cpu_aff = i;
|
||||||
|
|
||||||
@ -212,22 +221,31 @@ void bind_to_free_cpu(void) {
|
|||||||
#elif defined(__NetBSD__)
|
#elif defined(__NetBSD__)
|
||||||
c = cpuset_create();
|
c = cpuset_create();
|
||||||
if (c == NULL) PFATAL("cpuset_create failed");
|
if (c == NULL) PFATAL("cpuset_create failed");
|
||||||
|
|
||||||
cpuset_set(i, c);
|
cpuset_set(i, c);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__linux__)
|
#if defined(__linux__)
|
||||||
if (sched_setaffinity(0, sizeof(c), &c)) PFATAL("sched_setaffinity failed");
|
if (sched_setaffinity(0, sizeof(c), &c)) {
|
||||||
|
|
||||||
|
if (cpu_start == cpu_core_count)
|
||||||
|
PFATAL("sched_setaffinity failed for CPU %d, exit", i);
|
||||||
|
WARNF("sched_setaffinity failed to CPU %d, trying next CPU", i);
|
||||||
|
cpu_start++;
|
||||||
|
goto try
|
||||||
|
;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
#elif defined(__FreeBSD__) || defined(__DragonFly__)
|
#elif defined(__FreeBSD__) || defined(__DragonFly__)
|
||||||
if (pthread_setaffinity_np(pthread_self(), sizeof(c), &c))
|
if (pthread_setaffinity_np(pthread_self(), sizeof(c), &c))
|
||||||
PFATAL("pthread_setaffinity failed");
|
PFATAL("pthread_setaffinity failed");
|
||||||
#elif defined(__NetBSD__)
|
#elif defined(__NetBSD__)
|
||||||
if (pthread_setaffinity_np(pthread_self(), cpuset_size(c), c))
|
if (pthread_setaffinity_np(pthread_self(), cpuset_size(c), c))
|
||||||
PFATAL("pthread_setaffinity failed");
|
PFATAL("pthread_setaffinity failed");
|
||||||
|
|
||||||
cpuset_destroy(c);
|
cpuset_destroy(c);
|
||||||
#else
|
#else
|
||||||
// this will need something for other platforms
|
// this will need something for other platforms
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user