Setting the AFL_I_AM_THE_FORKSERVER environment variable in the begining of the forkserver child process, and unsetting it when the target is launched

This commit is contained in:
Alexandre DOYEN
2025-05-04 11:36:01 +02:00
parent c340a022e2
commit cd0cb1e731
2 changed files with 3 additions and 0 deletions

View File

@ -1046,6 +1046,7 @@ static void __afl_start_forkserver(void) {
/* In child process: close fds, resume execution. */
if (unlikely(!child_pid)) { // just to signal afl-fuzz faster
unsetenv("AFL_I_AM_THE_FORKSERVER");
//(void)nice(-20);

View File

@ -878,6 +878,8 @@ void afl_fsrv_start(afl_forkserver_t *fsrv, char **argv,
/* CHILD PROCESS */
setenv("AFL_I_AM_THE_FORKSERVER", "1", 0);
// enable terminating on sigpipe in the children
struct sigaction sa;
memset((char *)&sa, 0, sizeof(sa));