Skip to content

Commit a70fd8c

Browse files
committed
consume AFL++ status value in SHM input fuzzing mode
1 parent 15fcedd commit a70fd8c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

harness/fuzzware_harness/native/native_hooks.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ uint8_t coverage_bitmap[MAP_SIZE];
116116
static void determine_input_mode() {
117117
char *id_str;
118118
int shm_id;
119+
int tmp;
119120

120121
id_str = getenv(SHM_FUZZ_ENV_VAR);
121122
if (id_str) {
@@ -125,6 +126,13 @@ static void determine_input_mode() {
125126
perror("[!] could not access fuzzing shared memory");
126127
exit(1);
127128
}
129+
130+
// AFL++ detected. Read its status value
131+
if(read(FORKSRV_FD, &tmp, 4) != 4) {
132+
perror("[!] did not receive AFL++ status value");
133+
exit(1);
134+
}
135+
128136
input_mode_SHM = true;
129137
}
130138
}

0 commit comments

Comments
 (0)