diff mbox series

[RFC,v2,03/17] fuzz: Keep memory mapped for fork-based fuzzer

Message ID 20190805071038.32146-4-alxndr@bu.edu (mailing list archive)
State New, archived
Headers show
Series [RFC,v2,01/17] fuzz: Move initialization from main to qemu_init | expand

Commit Message

Alexander Bulekov Aug. 5, 2019, 7:11 a.m. UTC
Otherwise, the RAM is unmapped from the child-processes, which breaks
any fuzz tests relying on DMA.

Signed-off-by: Alexander Oleinik <alxndr@bu.edu>
---
 exec.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Stefan Hajnoczi Aug. 9, 2019, 9:01 a.m. UTC | #1
On Mon, Aug 05, 2019 at 07:11:04AM +0000, Oleinik, Alexander wrote:
> Otherwise, the RAM is unmapped from the child-processes, which breaks
> any fuzz tests relying on DMA.
> 
> Signed-off-by: Alexander Oleinik <alxndr@bu.edu>
> ---
>  exec.c | 2 ++
>  1 file changed, 2 insertions(+)

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
diff mbox series

Patch

diff --git a/exec.c b/exec.c
index 3e78de3b8f..b3b56db8f0 100644
--- a/exec.c
+++ b/exec.c
@@ -2317,7 +2317,9 @@  static void ram_block_add(RAMBlock *new_block, Error **errp, bool shared)
         qemu_ram_setup_dump(new_block->host, new_block->max_length);
         qemu_madvise(new_block->host, new_block->max_length, QEMU_MADV_HUGEPAGE);
         /* MADV_DONTFORK is also needed by KVM in absence of synchronous MMU */
+#ifndef CONFIG_FUZZ /* This conflicts with fork-based fuzzing */
         qemu_madvise(new_block->host, new_block->max_length, QEMU_MADV_DONTFORK);
+#endif
         ram_block_notify_add(new_block->host, new_block->max_length);
     }
 }