]> xenbits.xensource.com Git - qemu-xen.git/commit
vfio-helpers: Fix qemu_vfio_open_pci() crash
authorMarkus Armbruster <armbru@redhat.com>
Tue, 27 Nov 2018 08:41:43 +0000 (09:41 +0100)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Tue, 2 Apr 2019 01:36:21 +0000 (20:36 -0500)
commit93ef995b2c4c39304bde5f2440e0f286aaa160e7
tree2a5db7f2dd163fbbccd2baa0c0744af1a0da761a
parente31de8e7bb737d263afab59d9bbd60c179c9ca0a
vfio-helpers: Fix qemu_vfio_open_pci() crash

qemu_vfio_open_common() initializes s->lock only after passing s to
qemu_vfio_dma_map() via qemu_vfio_init_ramblock().
qemu_vfio_dma_map() tries to lock the uninitialized lock and crashes.

Fix by initializing s->lock first.

RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=1645840
Fixes: 418026ca43bc2626db092d7558258f9594366f28
Cc: qemu-stable@nongnu.org
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-id: 20181127084143.1113-1-armbru@redhat.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
(cherry picked from commit 549b50a31d28f2687a47e827a1e17300784a2c44)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
util/vfio-helpers.c