]> git.ipfire.org Git - thirdparty/qemu.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)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Thu, 26 Jun 2014 19:18:51 +0000 (14:18 -0500)
commit68801b7be1ddabe3495f68145b1202049b1486c2
tree0b6510269fe215cc1ac349b4839b9950d83b3167
parent609f5bf6fecb78ada914b88598ae8ba43e304e36
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>
(cherry picked from commit 36cf2a37132c7f01fa9adb5f95f5312b27742fd4)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
hw/virtio/virtio.c