summaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorLuiz Capitulino2013-04-18 17:53:32 +0200
committerLuiz Capitulino2013-04-19 14:32:44 +0200
commitdcc6ceffc066745777960a1f0d32f3a555924f65 (patch)
tree5ecaf08ef3f85376848d1cf17a4d1c5c63079969 /docs
parentmonitor: fix the wrong order of releasing keys (diff)
downloadqemu-dcc6ceffc066745777960a1f0d32f3a555924f65.tar.gz
qemu-dcc6ceffc066745777960a1f0d32f3a555924f65.tar.xz
qemu-dcc6ceffc066745777960a1f0d32f3a555924f65.zip
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>
Diffstat (limited to 'docs')
0 files changed, 0 insertions, 0 deletions