]> xenbits.xensource.com Git - qemu-upstream-4.2-testing.git/commit
virtio: validate num_sg when mapping
authorMichael S. Tsirkin <mst@redhat.com>
Wed, 4 Mar 2015 16:44:22 +0000 (16:44 +0000)
committerStefano Stabellini <stefano.stabellini@eu.citrix.com>
Thu, 5 Mar 2015 13:22:11 +0000 (13:22 +0000)
commitf25df9882827c8e488fe3f36cc7796b99302391b
tree131efa781943df256e71b41e114498be6827abc4
parentd05d97d465db38decd37b7f93013d9331fb5ed2b
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