aboutsummaryrefslogtreecommitdiff
path: root/utils/afl_network_proxy
diff options
context:
space:
mode:
authorrealmadsci <71108352+realmadsci@users.noreply.github.com>2021-03-15 11:45:58 -0400
committerrealmadsci <71108352+realmadsci@users.noreply.github.com>2021-03-15 13:03:16 -0700
commit01ad7610beaf772063c9011daae5fa3a3232494c (patch)
treed8718a1a23521964af1bfcbba767c1d1af8e251b /utils/afl_network_proxy
parent01ad0f3c6a45e28eb99e7076f97af2e2a9516c45 (diff)
downloadafl++-01ad7610beaf772063c9011daae5fa3a3232494c.tar.gz
Remove AFL_PRELOAD and AFL_USE_QASAN handlers
These are now processed in afl-qemu-trace so that the "copy+paste" code that is in all of the other AFL tools can be removed. This also allows the AFL_USE_QASAN flag to work the same when used with tools like afl-fuzz as it does with afl-qemu-trace. This is important in situations where loading the QASAN library changes the address of your desired entrypoint, or for crash validation using the same environment that afl-fuzz was using. With this change, the same set of environment variables can be used in exactly the same way between afl-fuzz, afl-showmap, and afl-qemu-trace, and you will get exactly the same guest environment.
Diffstat (limited to 'utils/afl_network_proxy')
-rw-r--r--utils/afl_network_proxy/afl-network-server.c33
1 files changed, 1 insertions, 32 deletions
diff --git a/utils/afl_network_proxy/afl-network-server.c b/utils/afl_network_proxy/afl-network-server.c
index fe225416..0dfae658 100644
--- a/utils/afl_network_proxy/afl-network-server.c
+++ b/utils/afl_network_proxy/afl-network-server.c
@@ -237,38 +237,7 @@ static void set_up_environment(afl_forkserver_t *fsrv) {
if (fsrv->qemu_mode) {
- u8 *qemu_preload = getenv("QEMU_SET_ENV");
- u8 *afl_preload = getenv("AFL_PRELOAD");
- u8 *buf;
-
- s32 i, afl_preload_size = strlen(afl_preload);
- for (i = 0; i < afl_preload_size; ++i) {
-
- if (afl_preload[i] == ',') {
-
- PFATAL(
- "Comma (',') is not allowed in AFL_PRELOAD when -Q is "
- "specified!");
-
- }
-
- }
-
- if (qemu_preload) {
-
- buf = alloc_printf("%s,LD_PRELOAD=%s,DYLD_INSERT_LIBRARIES=%s",
- qemu_preload, afl_preload, afl_preload);
-
- } else {
-
- buf = alloc_printf("LD_PRELOAD=%s,DYLD_INSERT_LIBRARIES=%s",
- afl_preload, afl_preload);
-
- }
-
- setenv("QEMU_SET_ENV", buf, 1);
-
- afl_free(buf);
+ /* afl-qemu-trace takes care of converting AFL_PRELOAD. */
} else {