qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] 72d919: Bugfix: Handle error if VM Generation


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] 72d919: Bugfix: Handle error if VM Generation ID device no...
Date: Wed, 15 Mar 2017 12:45:10 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 72d9196f1ef588c19821d0a4fb563836fdb2a0b7
      
https://github.com/qemu/qemu/commit/72d9196f1ef588c19821d0a4fb563836fdb2a0b7
  Author: Ben Warren <address@hidden>
  Date:   2017-03-15 (Wed, 15 Mar 2017)

  Changed paths:
    M hmp.c
    M hw/acpi/vmgenid.c

  Log Message:
  -----------
  Bugfix: Handle error if VM Generation ID device not present

This was crashing due to NULL-pointer dereference

QMP Test case:
==============

(QEMU) query-vm-generation-id
{"error": {"class": "GenericError", "desc": "VM Generation ID device not
found"}}

HMP Test case:
==============
virsh # qemu-monitor-command --hmp 3 info vm-generation-id
VM Generation ID device not found

Signed-off-by: Ben Warren <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
Reviewed-by: Eric Blake <address@hidden>


  Commit: 168e4af3c129534ee7d81edc238a9aa9ca0dd474
      
https://github.com/qemu/qemu/commit/168e4af3c129534ee7d81edc238a9aa9ca0dd474
  Author: Jason Wang <address@hidden>
  Date:   2017-03-15 (Wed, 15 Mar 2017)

  Changed paths:
    M hw/virtio/virtio.c

  Log Message:
  -----------
  virtio: guard against NULL pfn

To avoid access stale memory region cache after reset, this patch
check the existence of virtqueue pfn for all exported virtqueue access
helpers before trying to use them.

Cc: Cornelia Huck <address@hidden>
Cc: Paolo Bonzini <address@hidden>
Reviewed-by: Cornelia Huck <address@hidden>
Signed-off-by: Jason Wang <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: e0e2d644096c79a71099b176d08f465f6803a8b1
      
https://github.com/qemu/qemu/commit/e0e2d644096c79a71099b176d08f465f6803a8b1
  Author: Jason Wang <address@hidden>
  Date:   2017-03-15 (Wed, 15 Mar 2017)

  Changed paths:
    M hw/virtio/virtio.c

  Log Message:
  -----------
  virtio: destroy region cache during reset

We don't destroy region cache during reset which can make the maps
of previous driver leaked to a buggy or malicious driver that don't
set vring address before starting to use the device. Fix this by
destroy the region cache during reset and validate it before trying to
see them.

Cc: Cornelia Huck <address@hidden>
Cc: Paolo Bonzini <address@hidden>
Reviewed-by: Cornelia Huck <address@hidden>
Signed-off-by: Jason Wang <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: e45da653223869849877ee8f4b86f511f891d4f8
      
https://github.com/qemu/qemu/commit/e45da653223869849877ee8f4b86f511f891d4f8
  Author: Jason Wang <address@hidden>
  Date:   2017-03-15 (Wed, 15 Mar 2017)

  Changed paths:
    M hw/virtio/virtio.c

  Log Message:
  -----------
  virtio: validate address space cache during init

We don't check the return value of address_space_cache_init(), this
may lead buggy driver use incorrect region caches. Instead of
triggering an assert, catch and warn this early in
virtio_init_region_cache().

Cc: Cornelia Huck <address@hidden>
Cc: Paolo Bonzini <address@hidden>
Reviewed-by: Cornelia Huck <address@hidden>
Signed-off-by: Jason Wang <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: 3716d5902d743e9a395b7d82f48df4fa56ed1ad3
      
https://github.com/qemu/qemu/commit/3716d5902d743e9a395b7d82f48df4fa56ed1ad3
  Author: Jason Wang <address@hidden>
  Date:   2017-03-15 (Wed, 15 Mar 2017)

  Changed paths:
    M hw/pci/pci.c
    M include/hw/pci/pci.h

  Log Message:
  -----------
  pci: introduce a bus master container

96a8821d2141 ("virtio: unbreak virtio-pci with IOMMU after caching ring
translations") tries to make IOMMU works with virtio memory region
cache, but it requires IOMMU to be created before any virtio
devices. This is sub optimal, fixing this by introduce a bus master
container to make sure address space can be initialized during device
registering, and then we can safely set alias and make
bus_master_enable_region as its subregion during bus master
initialization.

Cc: Paolo Bonzini <address@hidden>
Signed-off-by: Jason Wang <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: f0edf2397896aef1799dc9b5818683ea16577030
      
https://github.com/qemu/qemu/commit/f0edf2397896aef1799dc9b5818683ea16577030
  Author: Jason Wang <address@hidden>
  Date:   2017-03-15 (Wed, 15 Mar 2017)

  Changed paths:
    M hw/virtio/virtio-pci.c

  Log Message:
  -----------
  Revert "virtio: unbreak virtio-pci with IOMMU after caching ring translations"

This reverts commit
96a8821d21411f10d77ea994af369c6e5c35a2cc. Previous patch is a better
solution which does not require a strict order between virtio and IOMMU.

CC: Paolo Bonzini <address@hidden>
Signed-off-by: Jason Wang <address@hidden>


  Commit: 60a8d8023473dd24957b3a66824f66cd35b80d64
      
https://github.com/qemu/qemu/commit/60a8d8023473dd24957b3a66824f66cd35b80d64
  Author: Jason Wang <address@hidden>
  Date:   2017-03-15 (Wed, 15 Mar 2017)

  Changed paths:
    M hw/virtio/virtio-pci.c

  Log Message:
  -----------
  virtio-pci: reset modern vq meta data

We don't reset proxy->vqs[].{num|desc[]|avail[]|used[]}. This means if
a driver enable the vq without setting vq address after reset. The old
addresses were leaked. Fixing this by resetting modern vq meta data
during device reset.

Cc: address@hidden
Signed-off-by: Jason Wang <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: 1883ff34b540daacae948f493b0ba525edf5f642
      
https://github.com/qemu/qemu/commit/1883ff34b540daacae948f493b0ba525edf5f642
  Author: Peter Maydell <address@hidden>
  Date:   2017-03-15 (Wed, 15 Mar 2017)

  Changed paths:
    M hmp.c
    M hw/acpi/vmgenid.c
    M hw/pci/pci.c
    M hw/virtio/virtio-pci.c
    M hw/virtio/virtio.c
    M include/hw/pci/pci.h

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging

virtio, pc: fixes

Some fixes to fallback from using virtio caching,
pls a minor vm gen id fix.

Signed-off-by: Michael S. Tsirkin <address@hidden>

# gpg: Signature made Wed 15 Mar 2017 17:59:25 GMT
# gpg:                using RSA key 0x281F0DB8D28D5469
# gpg: Good signature from "Michael S. Tsirkin <address@hidden>"
# gpg:                 aka "Michael S. Tsirkin <address@hidden>"
# Primary key fingerprint: 0270 606B 6F3C DF3D 0B17  0970 C350 3912 AFBE 8E67
#      Subkey fingerprint: 5D09 FD08 71C8 F85B 94CA  8A0D 281F 0DB8 D28D 5469

* remotes/mst/tags/for_upstream:
  virtio-pci: reset modern vq meta data
  Revert "virtio: unbreak virtio-pci with IOMMU after caching ring translations"
  pci: introduce a bus master container
  virtio: validate address space cache during init
  virtio: destroy region cache during reset
  virtio: guard against NULL pfn
  Bugfix: Handle error if VM Generation ID device not present

Signed-off-by: Peter Maydell <address@hidden>


Compare: https://github.com/qemu/qemu/compare/de71fb96bfcd...1883ff34b540

reply via email to

[Prev in Thread] Current Thread [Next in Thread]