From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55721) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XTbiL-0004uN-1O for qemu-devel@nongnu.org; Mon, 15 Sep 2014 15:13:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XTbiC-0003tl-Qd for qemu-devel@nongnu.org; Mon, 15 Sep 2014 15:13:28 -0400 Date: Mon, 15 Sep 2014 14:09:34 -0400 From: Luiz Capitulino Message-ID: <20140915140934.17c1bfea@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [PATCH] virtio-balloon: fix buffer overflow in memory stats feature List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel Cc: qemu-stable@nongnu.org When a QMP client changes the polling interval time by setting the guest-stats-polling-interval property, the interval value is stored and manipuled as an int64_t variable. However, the balloon_stats_change_timer() function, which is used to set the actual timer with the interval value, takes an int instead, causing an overflow for big interval values. Fix it. Signed-off-by: Luiz Capitulino --- hw/virtio/virtio-balloon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c index 2c30b3d..9629264 100644 --- a/hw/virtio/virtio-balloon.c +++ b/hw/virtio/virtio-balloon.c @@ -87,7 +87,7 @@ static void balloon_stats_destroy_timer(VirtIOBalloon *s) } } -static void balloon_stats_change_timer(VirtIOBalloon *s, int secs) +static void balloon_stats_change_timer(VirtIOBalloon *s, int64_t secs) { timer_mod(s->stats_timer, qemu_clock_get_ms(QEMU_CLOCK_VIRTUAL) + secs * 1000); } -- 1.9.3