qemu/hw
Luiz Capitulino dcc6ceffc0 virtio-balloon: fix integer overflow in BALLOON_CHANGE QMP event
Because dev->actual is uint32_t, the expression 'dev->actual <<
VIRTIO_BALLOON_PFN_SHIFT' is truncated to 32 bits. This overflows when
dev->actual >= 1048576.

To reproduce:

 1. Start a VM with a QMP socket and 5G of RAM
 2. Connect to the QMP socket, negotiate capabilities and issue:

   { "execute":"balloon", "arguments": { "value": 1073741824 } }

 3. Watch for BALLOON_CHANGE QMP events, the last one will incorretly be:

   { "timestamp": { "seconds": 1366228965, "microseconds": 245466 },
     "event": "BALLOON_CHANGE", "data": { "actual": 5368709120 } }

To fix it this commit casts it to ram_addr_t, which is ram_size's type.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
2013-04-19 08:32:44 -04:00
..
9pfs
acpi
alpha
arm console: add GraphicHwOps 2013-04-16 09:03:49 +02:00
audio
block m25p80: Add debug message for no bdrv 2013-04-16 10:25:34 +02:00
bt
char virtio-console: Remove any pending watches on close 2013-04-16 11:52:09 +02:00
core Merge remote-tracking branch 'afaerber/qom-cpu' into staging 2013-04-16 10:28:36 -05:00
cpu
cris
display configure: eliminate target_libs_softmmu 2013-04-18 14:12:31 +02:00
dma stream: Remove app argument hack 2013-04-16 10:04:23 +02:00
gpio
i2c
i386 kvmvapic: Replace FROM_SYSBUS() with QOM type cast 2013-04-16 01:19:46 +02:00
ide Merge remote-tracking branch 'bonzini/hw-dirs' into staging 2013-04-15 17:06:04 -05:00
input
intc ioapic: Replace FROM_SYSBUS() with QOM type cast 2013-04-16 01:19:46 +02:00
isa
lm32
m68k
microblaze stream: Remove app argument hack 2013-04-16 10:04:23 +02:00
mips
misc
moxie
net virtio-net: cleanup: init and exit function. 2013-04-17 10:28:59 -05:00
nvram
openrisc
pci
pci-bridge
pci-host
ppc
s390x virtio-net-ccw: switch to the new API. 2013-04-17 10:28:59 -05:00
scsi
sd
sh4
sparc
sparc64
ssi
timer
tpm
unicore32 console: add GraphicHwOps 2013-04-16 09:03:49 +02:00
usb use libusb for usb-host 2013-04-16 12:04:09 +02:00
virtio virtio-balloon: fix integer overflow in BALLOON_CHANGE QMP event 2013-04-19 08:32:44 -04:00
watchdog
xen
xtensa
Makefile.objs