stop the fuzzer if AFL_QEMU_PERSISTENT_ADDR is wrong

This commit is contained in:
Andrea Fioraldi
2020-01-31 18:49:22 +01:00
parent e5f081586d
commit f5d4618702
2 changed files with 9 additions and 1 deletions

View File

@ -272,6 +272,8 @@ static void afl_forkserver(CPUState *cpu) {
if (write(FORKSRV_FD + 1, tmp, 4) != 4) return; if (write(FORKSRV_FD + 1, tmp, 4) != 4) return;
afl_forksrv_pid = getpid(); afl_forksrv_pid = getpid();
int first_run = 1;
/* All right, let's await orders... */ /* All right, let's await orders... */
@ -349,6 +351,8 @@ static void afl_forkserver(CPUState *cpu) {
again. */ again. */
if (WIFSTOPPED(status)) child_stopped = 1; if (WIFSTOPPED(status)) child_stopped = 1;
else if(unlikely(first_run)) exit(12); // Persistent is wrong
first_run = 0;
if (write(FORKSRV_FD + 1, &status, 4) != 4) exit(7); if (write(FORKSRV_FD + 1, &status, 4) != 4) exit(7);

View File

@ -189,7 +189,11 @@ u8 run_target(char** argv, u32 timeout) {
" - The binary, at least in some circumstances, exits in a way " " - The binary, at least in some circumstances, exits in a way "
"that\n" "that\n"
" also kills the parent process - raise() could be the " " also kills the parent process - raise() could be the "
"culprit.\n\n" "culprit.\n"
" - If using persistent mode with QEMU, AFL_QEMU_PERSISTENT_ADDR "
"is\n"
" probably not valid (hint: add the base address in case of PIE)"
"\n\n"
"If all else fails you can disable the fork server via " "If all else fails you can disable the fork server via "
"AFL_NO_FORKSRV=1.\n", "AFL_NO_FORKSRV=1.\n",
mem_limit); mem_limit);