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 virtio-9p: Fix virtio-9p no longer building after hw-dirs branch merge 2013-04-09 07:47:00 -05:00
acpi hw: move target-independent files to subdirectories 2013-04-08 18:13:12 +02:00
alpha include: avoid useless includes of exec/ headers 2013-04-15 18:19:26 +02:00
arm console: add GraphicHwOps 2013-04-16 09:03:49 +02:00
audio hw: move private headers to hw/ subdirectories. 2013-04-08 18:13:16 +02:00
block m25p80: Add debug message for no bdrv 2013-04-16 10:25:34 +02:00
bt sysemu: avoid proliferation of include/ subdirectories 2013-04-15 18:19:25 +02:00
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 hw: move ARM CPU cores to hw/cpu/, configure with default-configs/ 2013-04-08 18:13:16 +02:00
cris hw: move private headers to hw/ subdirectories. 2013-04-08 18:13:16 +02:00
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 hw: move GPIO interfaces to hw/gpio/, configure with default-configs/ 2013-04-08 18:13:16 +02:00
i2c hw: move private headers to hw/ subdirectories. 2013-04-08 18:13:16 +02:00
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 arm: fix location of some include files 2013-04-15 15:16:01 +02:00
intc ioapic: Replace FROM_SYSBUS() with QOM type cast 2013-04-16 01:19:46 +02:00
isa sysemu: avoid proliferation of include/ subdirectories 2013-04-15 18:19:25 +02:00
lm32 arm: fix location of some include files 2013-04-15 15:16:01 +02:00
m68k hw: move char devices to hw/char/, configure via default-configs/ 2013-04-08 18:13:14 +02:00
microblaze stream: Remove app argument hack 2013-04-16 10:04:23 +02:00
mips sysemu: avoid proliferation of include/ subdirectories 2013-04-15 18:19:25 +02:00
misc sysemu: avoid proliferation of include/ subdirectories 2013-04-15 18:19:25 +02:00
moxie hw: move MC146818RTC to hw/timer/, configure via default-configs/ 2013-04-08 18:13:13 +02:00
net virtio-net: cleanup: init and exit function. 2013-04-17 10:28:59 -05:00
nvram hw: move NVRAM interfaces to hw/nvram/, configure with default-configs/ 2013-04-08 18:13:16 +02:00
openrisc hw: move headers to include/ 2013-04-08 18:13:10 +02:00
pci hw: move PCI bridges to hw/pci-* or hw/ARCH 2013-04-08 18:13:14 +02:00
pci-bridge hw: move private headers to hw/ subdirectories. 2013-04-08 18:13:16 +02:00
pci-host hw: move private headers to hw/ subdirectories. 2013-04-08 18:13:16 +02:00
ppc sysemu: avoid proliferation of include/ subdirectories 2013-04-15 18:19:25 +02:00
s390x virtio-net-ccw: switch to the new API. 2013-04-17 10:28:59 -05:00
scsi hw: move private headers to hw/ subdirectories. 2013-04-08 18:13:16 +02:00
sd Typo, spelling and grammatical fixes 2013-04-12 14:33:20 +02:00
sh4 arm: fix location of some include files 2013-04-15 15:16:01 +02:00
sparc sysemu: avoid proliferation of include/ subdirectories 2013-04-15 18:19:25 +02:00
sparc64 hw: move PCI bridges to hw/pci-* or hw/ARCH 2013-04-08 18:13:14 +02:00
ssi hw: move SSI controllers to hw/ssi/, configure via default-configs/ 2013-04-08 18:13:13 +02:00
timer arm: fix location of some include files 2013-04-15 15:16:01 +02:00
tpm sysemu: avoid proliferation of include/ subdirectories 2013-04-15 18:19:25 +02:00
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 hw: move watchdogs to hw/watchdog, configure via default-configs/ 2013-04-08 18:13:13 +02:00
xen sysemu: avoid proliferation of include/ subdirectories 2013-04-15 18:19:25 +02:00
xtensa sysemu: avoid proliferation of include/ subdirectories 2013-04-15 18:19:25 +02:00
Makefile.objs tpm: reorganize headers and split hardware part 2013-04-15 18:19:25 +02:00