[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC PATCH v2 05/17] fuzz: Add direct receive function
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [RFC PATCH v2 05/17] fuzz: Add direct receive function for qtest server |
Date: |
Fri, 9 Aug 2019 10:23:34 +0100 |
User-agent: |
Mutt/1.12.0 (2019-05-25) |
On Mon, Aug 05, 2019 at 07:11:06AM +0000, Oleinik, Alexander wrote:
> The direct receive function qtest_server_recv is directly invoked by the
> qtest client, when the server and client exist within the same process.
>
> Signed-off-by: Alexander Oleinik <address@hidden>
> ---
> include/sysemu/qtest.h | 4 ++++
> qtest.c | 14 ++++++++++++++
> 2 files changed, 18 insertions(+)
qtest.c has two parts:
1. The qtest protocol handler
2. The chardev/qtest_init() code
This patch uses #ifdefs to leave most of the code unmodified, but this
is hacky since we need to pass around a NULL CharBackend pointer in
order to reuse the code. There is a danger that someone will modify the
core code and operate on chr not knowing it will break fuzzing.
A cleaner approach is to refactor the qtest protocol handler code to be
transport-independent with a send(void *opaque, const char *str, size_t
len) function pointer provided by the actual transport. That way the
core code doesn't know about CharBackend and can never accidentally
touch it.
One way of doing this is to introduce a global qtest_send() function
pointer and pass a void *opaque value through the core qtest protocol
handler code.
If you introduce a separate qtest-fuzz.c file then no #ifdefs are
necessary because the conditional compilation can be performed by
CONFIG_FUZZ in Makefile.objs:
obj-$(CONFIG_FUZZ) += qtest-fuzz.o
signature.asc
Description: PGP signature
- Re: [Qemu-devel] [RFC PATCH v2 02/17] fuzz: Add fuzzer configure options, (continued)
- [Qemu-devel] [RFC PATCH v2 03/17] fuzz: Keep memory mapped for fork-based fuzzer, Oleinik, Alexander, 2019/08/05
- [Qemu-devel] [RFC PATCH v2 04/17] fuzz: Skip modules that were already initialized, Oleinik, Alexander, 2019/08/05
- [Qemu-devel] [RFC PATCH v2 05/17] fuzz: Add direct receive function for qtest server, Oleinik, Alexander, 2019/08/05
- Re: [Qemu-devel] [RFC PATCH v2 05/17] fuzz: Add direct receive function for qtest server,
Stefan Hajnoczi <=
- [Qemu-devel] [RFC PATCH v2 06/17] fuzz: Add FUZZ_TARGET module type, Oleinik, Alexander, 2019/08/05
- [Qemu-devel] [RFC PATCH v2 07/17] fuzz: Add ramfile qemu-file type, Oleinik, Alexander, 2019/08/05
- [Qemu-devel] [RFC PATCH v2 09/17] fuzz: hardcode needed objects into i386 target, Oleinik, Alexander, 2019/08/05
- [Qemu-devel] [RFC PATCH v2 08/17] fuzz: Export the qemu_savevm_live_state function, Oleinik, Alexander, 2019/08/05