Skip to content

Commit 08f6e1d

Browse files
committed
children terminate on sigpipe
1 parent 28e457e commit 08f6e1d

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/afl-forkserver.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,12 @@ static void afl_fauxsrv_execv(afl_forkserver_t *fsrv, char **argv) {
251251

252252
}
253253

254+
// enable terminating on sigpipe in the childs
255+
struct sigaction sa;
256+
memset((char *)&sa, 0, sizeof(sa));
257+
sa.sa_handler = SIG_DFL;
258+
sigaction(SIGPIPE, &sa, NULL);
259+
254260
signal(SIGCHLD, old_sigchld_handler);
255261
// FORKSRV_FD is for communication with AFL, we don't need it in the
256262
// child.
@@ -371,6 +377,13 @@ void afl_fsrv_start(afl_forkserver_t *fsrv, char **argv,
371377
if (!fsrv->fsrv_pid) {
372378

373379
/* CHILD PROCESS */
380+
381+
// enable terminating on sigpipe in the childs
382+
struct sigaction sa;
383+
memset((char *)&sa, 0, sizeof(sa));
384+
sa.sa_handler = SIG_DFL;
385+
sigaction(SIGPIPE, &sa, NULL);
386+
374387
struct rlimit r;
375388

376389
/* Umpf. On OpenBSD, the default fd limit for root users is set to

0 commit comments

Comments
 (0)