]> xenbits.xensource.com Git - qemu-xen.git/commit
vmstate: fix buffer overflow in target-arm/machine.c
authorMichael S. Tsirkin <mst@redhat.com>
Thu, 3 Apr 2014 16:51:42 +0000 (19:51 +0300)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Mon, 21 Jul 2014 03:05:54 +0000 (22:05 -0500)
commit9c01a91c7b201bcb7de04603450c3c64a2475f69
treee8c210aea2a3e0d6e95c30d3257af223cd85a8df
parent7cf5f5d087e3c46a5d60081443bc42b7c6f3ba1e
vmstate: fix buffer overflow in target-arm/machine.c

CVE-2013-4531

cpreg_vmstate_indexes is a VARRAY_INT32. A negative value for
cpreg_vmstate_array_len will cause a buffer overflow.

VMSTATE_INT32_LE was supposed to protect against this
but doesn't because it doesn't validate that input is
non-negative.

Fix this macro to valide the value appropriately.

The only other user of VMSTATE_INT32_LE doesn't
ever use negative numbers so it doesn't care.

Reported-by: Anthony Liguori <anthony@codemonkey.ws>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
(cherry picked from commit d2ef4b61fe6d33d2a5dcf100a9b9440de341ad62)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
vmstate.c