hw/arm/smmuv3: Fix Coverity issue in smmuv3_record_event
commit24af32e049684827286e24114a066e09d0dcdaaf
authorEric Auger <eric.auger@redhat.com>
Fri, 18 May 2018 16:48:07 +0000 (18 17:48 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Fri, 18 May 2018 16:48:07 +0000 (18 17:48 +0100)
treeedb264f7ebb723fb7c1973d72df39a5baa637a2e
parent04965bca4e659a78a73fb0de2bc394fc04282a70
hw/arm/smmuv3: Fix Coverity issue in smmuv3_record_event

Coverity complains about use of uninitialized Evt struct.
The EVT_SET_TYPE and similar setters use deposit32() on fields
in the struct, so they read the uninitialized existing values.
In cases where we don't set all the fields in the event struct
we'll end up leaking random uninitialized data from QEMU's
stack into the guest.

Initializing the struct with "Evt evt = {};" ought to satisfy
Coverity and fix the data leak.

Signed-off-by: Eric Auger <eric.auger@redhat.com>
Reported-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-id: 1526493784-25328-2-git-send-email-eric.auger@redhat.com
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
hw/arm/smmuv3.c