]> xenbits.xensource.com Git - qemu-upstream-4.3-testing.git/commit
virtio: validate num_sg when mapping
authorMichael S. Tsirkin <mst@redhat.com>
Wed, 4 Mar 2015 16:43:53 +0000 (16:43 +0000)
committerStefano Stabellini <stefano.stabellini@eu.citrix.com>
Thu, 5 Mar 2015 13:21:56 +0000 (13:21 +0000)
commit43e42a48e1f0417e5bc17e84491c4b6b5be7be01
tree17b778d0a1c57bf963c2b4411728abad20d794fd
parent857f258638f48ae390e98e9d161b402a86956459
virtio: validate num_sg when mapping

CVE-2013-4535
CVE-2013-4536

Both virtio-block and virtio-serial read,
VirtQueueElements are read in as buffers, and passed to
virtqueue_map_sg(), where num_sg is taken from the wire and can force
writes to indicies beyond VIRTQUEUE_MAX_SIZE.

To fix, validate num_sg.

Reported-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Cc: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
hw/virtio.c