qemu/hw/virtio
Jason Wang 5f5a131865 virtio: properly validate address before accessing config
There are several several issues in the current checking:

- The check was based on the minus of unsigned values which can overflow
- It was done after .{set|get}_config() which can lead crash when config_len
  is zero since vdev->config is NULL

Fix this by:

- Validate the address in virtio_pci_config_{read|write}() before
  .{set|get}_config
- Use addition instead minus to do the validation

Cc: Michael S. Tsirkin <mst@redhat.com>
Cc: Petr Matousek <pmatouse@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Petr Matousek <pmatouse@redhat.com>
Message-id: 1367905369-10765-1-git-send-email-jasowang@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-05-08 15:54:21 -05:00
..
dataplane hw: move virtio devices to hw/ subdirectories 2013-04-08 18:13:12 +02:00
Makefile.objs virtio: simplify Makefile conditionals 2013-04-19 16:18:11 +02:00
vhost.c virtio: remove virtiobindings. 2013-04-24 11:50:20 -05:00
virtio-balloon.c virtio: cleanup: init and exit function. 2013-04-24 11:50:21 -05:00
virtio-bus.c virtio: remove virtiobindings. 2013-04-24 11:50:20 -05:00
virtio-pci.c virtio-pci: fix level interrupts 2013-05-08 15:54:21 -05:00
virtio-pci.h virtio-pci: cleanup. 2013-04-24 11:50:20 -05:00
virtio-rng.c virtio: cleanup: init and exit function. 2013-04-24 11:50:21 -05:00
virtio.c virtio: properly validate address before accessing config 2013-05-08 15:54:21 -05:00