qemu/include
Michael Roth cee2dedb85 qapi: add visit_start_union and visit_end_union
In some cases an input visitor might bail out on filling out a
struct for various reasons, such as missing fields when running
in strict mode. In the case of a QAPI Union type, this may lead
to cases where the .kind field which encodes the union type
is uninitialized. Subsequently, other visitors, such as the
dealloc visitor, may use this .kind value as if it were
initialized, leading to assumptions about the union type which
in this case may lead to segfaults. For example, freeing an
integer value.

However, we can generally rely on the fact that the always-present
.data void * field that we generate for these union types will
always be NULL in cases where .kind is uninitialized (at least,
there shouldn't be a reason where we'd do this purposefully).

So pass this information on to Visitor implementation via these
optional start_union/end_union interfaces so this information
can be used to guard against the situation above. We will make
use of this information in a subsequent patch for the dealloc
visitor.

Cc: qemu-stable@nongnu.org
Reported-by: Fam Zheng <famz@redhat.com>
Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2014-09-26 13:14:10 -04:00
..
block async: aio_context_new(): Handle event_notifier_init failure 2014-09-22 11:39:48 +01:00
disas
exec - Memory: improve error reporting and avoid crashes on hotplug 2014-09-12 16:55:49 +01:00
fpu fpu: softfloat: drop INLINE macro 2014-06-23 11:00:12 -04:00
hw virtio: Fix wrong type cast from pointer to long 2014-09-24 12:51:38 +01:00
libdecnumber Fix new typos in comments (found by codespell) 2014-07-18 17:45:36 +04:00
migration vmstate: Add preallocation for migrating arrays (VMS_ALLOC flag) 2014-06-27 13:48:27 +02:00
monitor monitor: fix use after free 2014-08-18 14:39:10 -04:00
net net: move queue number into NICPeers 2014-06-27 11:19:31 +02:00
qapi qapi: add visit_start_union and visit_end_union 2014-09-26 13:14:10 -04:00
qemu async: aio_context_new(): Handle event_notifier_init failure 2014-09-22 11:39:48 +01:00
qom qom: Add cpu_exec_interrupt hook 2014-09-25 18:54:21 +01:00
sysemu Usual mix of patches, the most important being Alex and Marcelo's 2014-09-26 15:41:50 +01:00
ui console: Remove unused QEMU_BIG_ENDIAN_FLAG 2014-09-05 15:38:04 +02:00
config.h
elf.h target-tricore: Add target stubs and qom-cpu 2014-09-01 14:49:20 +01:00
glib-compat.h glib-compat.h: add new thread API emulation on top of pre-2.31 API 2014-06-10 07:44:01 +02:00
qemu-common.h cpu: init vmstate for ticks and clock offset 2014-09-11 12:20:32 +02:00
qemu-io.h
trace-tcg.h trace: [tcg] Generate TCG tracing routines 2014-08-12 14:26:12 +01:00
trace.h trace: [tcg] Include event definitions in "trace.h" 2014-08-12 14:26:12 +01:00