]> xenbits.xensource.com Git - qemu-upstream-4.4-testing.git/commit
virtio: validate num_sg when mapping
authorMichael S. Tsirkin <mst@redhat.com>
Thu, 3 Apr 2014 16:51:53 +0000 (19:51 +0300)
committerStefano Stabellini <stefano.stabellini@eu.citrix.com>
Thu, 5 Mar 2015 13:21:37 +0000 (13:21 +0000)
commit5202189b9e42209c23ca608025de9d5a305108a9
treea4ae439acb7969c109a0f12a6865666bbf9544b1
parent458864cc18fd7644db942ea98bc7b3132d24e168
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>
hw/virtio/virtio.c