Files
qemu/include/hw
Michael S. Tsirkin 7872f3e77e virtio-net: fix buffer overflow on invalid state load
CVE-2013-4148 QEMU 1.0 integer conversion in
virtio_net_load()@hw/net/virtio-net.c

Deals with loading a corrupted savevm image.

>         n->mac_table.in_use = qemu_get_be32(f);

in_use is int so it can get negative when assigned 32bit unsigned value.

>         /* MAC_TABLE_ENTRIES may be different from the saved image */
>         if (n->mac_table.in_use <= MAC_TABLE_ENTRIES) {

passing this check ^^^

>             qemu_get_buffer(f, n->mac_table.macs,
>                             n->mac_table.in_use * ETH_ALEN);

with good in_use value, "n->mac_table.in_use * ETH_ALEN" can get
positive and bigger than mac_table.macs. For example 0x81000000
satisfies this condition when ETH_ALEN is 6.

Fix it by making the value unsigned.
For consistency, change first_multi as well.

Note: all call sites were audited to confirm that
making them unsigned didn't cause any issues:
it turns out we actually never do math on them,
so it's easy to validate because both values are
always <= MAC_TABLE_ENTRIES.

Reviewed-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
(cherry picked from commit 71f7fe48e1)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2014-07-20 22:05:53 -05:00
..
2014-02-14 16:22:31 +01:00
2013-06-07 14:55:33 +02:00
2013-12-17 20:12:51 +00:00
2013-12-24 18:02:18 +01:00
2014-02-03 14:04:00 +00:00
2014-02-14 16:22:32 +01:00
2014-03-11 13:27:27 +02:00
2014-02-26 17:20:00 +00:00
2014-02-14 16:22:31 +01:00
2013-07-29 21:06:27 +02:00
2013-11-05 17:47:30 +01:00
2014-02-27 10:01:40 +00:00
2014-04-08 11:20:04 +02:00
2013-12-17 20:12:51 +00:00
2014-03-05 03:06:46 +01:00
2014-02-10 10:23:35 +02:00
2013-06-27 15:38:35 -05:00
2014-03-11 13:25:48 +02:00
2014-03-12 20:13:02 +01:00
2013-05-01 20:55:21 +04:00