summary refs log tree commit diff stats
path: root/tests/qtest/fuzz/fork_fuzz.c
diff options
context:
space:
mode:
authorAlexander Bulekov <alxndr@bu.edu>2023-02-04 23:29:50 -0500
committerAlexander Bulekov <alxndr@bu.edu>2023-02-16 23:02:46 -0500
commitd2e6f9272d337d1b23b588e7ead8500d40cbf4e9 (patch)
tree9507120477844cca3cb46c404b9fac47c39f1f92 /tests/qtest/fuzz/fork_fuzz.c
parentf031c95941e3dbc816416d5336ed6225a4933cfc (diff)
downloadfocaccia-qemu-d2e6f9272d337d1b23b588e7ead8500d40cbf4e9.tar.gz
focaccia-qemu-d2e6f9272d337d1b23b588e7ead8500d40cbf4e9.zip
fuzz: remove fork-fuzzing scaffolding
Fork-fuzzing provides a few pros, but our implementation prevents us
from using fuzzers other than libFuzzer, and may be causing issues such
as coverage-failure builds on OSS-Fuzz. It is not a great long-term
solution as it depends on internal implementation details of libFuzzer
(which is no longer in active development). Remove it in favor of other
methods of resetting state between inputs.

Signed-off-by: Alexander Bulekov <alxndr@bu.edu>
Reviewed-by: Darren Kenny <darren.kenny@oracle.com>
Diffstat (limited to 'tests/qtest/fuzz/fork_fuzz.c')
-rw-r--r--tests/qtest/fuzz/fork_fuzz.c41
1 files changed, 0 insertions, 41 deletions
diff --git a/tests/qtest/fuzz/fork_fuzz.c b/tests/qtest/fuzz/fork_fuzz.c
deleted file mode 100644
index 6ffb2a7937..0000000000
--- a/tests/qtest/fuzz/fork_fuzz.c
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Fork-based fuzzing helpers
- *
- * Copyright Red Hat Inc., 2019
- *
- * Authors:
- *  Alexander Bulekov   <alxndr@bu.edu>
- *
- * This work is licensed under the terms of the GNU GPL, version 2 or later.
- * See the COPYING file in the top-level directory.
- *
- */
-
-#include "qemu/osdep.h"
-#include "fork_fuzz.h"
-
-
-void counter_shm_init(void)
-{
-    /* Copy what's in the counter region to a temporary buffer.. */
-    void *copy = malloc(&__FUZZ_COUNTERS_END - &__FUZZ_COUNTERS_START);
-    memcpy(copy,
-           &__FUZZ_COUNTERS_START,
-           &__FUZZ_COUNTERS_END - &__FUZZ_COUNTERS_START);
-
-    /* Map a shared region over the counter region */
-    if (mmap(&__FUZZ_COUNTERS_START,
-             &__FUZZ_COUNTERS_END - &__FUZZ_COUNTERS_START,
-             PROT_READ | PROT_WRITE, MAP_SHARED | MAP_FIXED | MAP_ANONYMOUS,
-             0, 0) == MAP_FAILED) {
-        perror("Error: ");
-        exit(1);
-    }
-
-    /* Copy the original data back to the counter-region */
-    memcpy(&__FUZZ_COUNTERS_START, copy,
-           &__FUZZ_COUNTERS_END - &__FUZZ_COUNTERS_START);
-    free(copy);
-}
-
-