summary refs log tree commit diff stats
path: root/hw/xen/xen_backend.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2017-05-15 12:00:55 +0200
committerJeff Cody <jcody@redhat.com>2017-05-16 10:34:17 -0400
commit456af346297ebef86aa097b3609534d34f3d2f75 (patch)
tree1218798b5b00599fe0c458ad83049def398d5567 /hw/xen/xen_backend.c
parent34db05e7ffe8d61ca7288b9532ad6e8300853318 (diff)
downloadfocaccia-qemu-456af346297ebef86aa097b3609534d34f3d2f75.tar.gz
focaccia-qemu-456af346297ebef86aa097b3609534d34f3d2f75.zip
curl: avoid recursive locking of BDRVCURLState mutex
The curl driver has a ugly hack where, if it cannot find an empty CURLState,
it just uses aio_poll to wait for one to be empty.  This is probably
buggy when used together with dataplane, and the simplest way to fix it
is to use coroutines instead.

A more immediate effect of the bug however is that it can cause a
recursive call to curl_readv_bh_cb and recursively taking the
BDRVCURLState mutex.  This causes a deadlock.

The fix is to unlock the mutex around aio_poll, but for cleanliness we
should also take the mutex around all calls to curl_init_state, even if
reaching the unlock/lock pair is impossible.  The same is true for
curl_clean_state.

Reported-by: Kun Wei <kuwei@redhat.com>
Tested-by: Richard W.M. Jones <rjones@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Jeff Cody <jcody@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 20170515100059.15795-4-pbonzini@redhat.com
Cc: qemu-stable@nongnu.org
Cc: Jeff Cody <jcody@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Jeff Cody <jcody@redhat.com>
Diffstat (limited to 'hw/xen/xen_backend.c')
0 files changed, 0 insertions, 0 deletions