numam-dpdk/lib/librte_vhost
Wenjie Sun 054617fd82 vhost: fix deadlock in driver unregister
In rte_vhost_driver_unregister(), the connection fd is
removed from the fdset using fdset_try_del(). Call to
this function may fail if the corresponding fd is in
busy state, indicating that event dispatcher is
executing the read or write callback on this fd.
When it happens, rte_vhost_driver_unregister() keeps
trying to remove the fd from the set until it is no
more busy.

This situation is causing a deadlock, because
rte_vhost_driver_unregister() keeps trying to remove
the fd from the set with vhost_user.mutex held, while
the callback executed by the dispatcher,
vhost_user_read_cb(), also takes this mutex at
numerous places.

The fix consists in releasing vhost_user.mutex between
each retry in vhost_driver_unregister().

Fixes: 8b4b949144 ("vhost: fix dead lock on closing in server mode")
Cc: stable@dpdk.org

Signed-off-by: Wenjie Sun <findtheonlyway@gmail.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2019-02-22 14:39:49 +01:00
..
fd_man.c vhost: fix race condition when adding fd in the fdset 2018-12-21 16:22:40 +01:00
fd_man.h vhost: fix race condition when adding fd in the fdset 2018-12-21 16:22:40 +01:00
iotlb.c vhost: flush IOTLB cache on new mem table handling 2018-08-05 01:47:47 +02:00
iotlb.h vhost: flush IOTLB cache on new mem table handling 2018-08-05 01:47:47 +02:00
Makefile vhost/crypto: fix shared lib build without cryptodev 2018-10-26 22:14:05 +02:00
meson.build vhost: add config flag for postcopy 2018-10-18 10:24:39 +02:00
rte_vdpa.h vhost: remove vDPA available ring relay helper 2019-02-08 19:27:07 +01:00
rte_vhost_crypto.h vhost/crypto: use separate session mempools 2019-01-10 16:57:22 +01:00
rte_vhost_version.map vhost: add external message handling to the API 2019-02-08 19:27:07 +01:00
rte_vhost.h vhost: add external message handling to the API 2019-02-08 19:27:07 +01:00
socket.c vhost: fix deadlock in driver unregister 2019-02-22 14:39:49 +01:00
vdpa.c vhost: remove vDPA available ring relay helper 2019-02-08 19:27:07 +01:00
vhost_crypto.c vhost: add external message handling to the API 2019-02-08 19:27:07 +01:00
vhost_user.c vhost: add external message handling to the API 2019-02-08 19:27:07 +01:00
vhost_user.h vhost: remove unused function prototype 2019-01-18 09:47:26 +01:00
vhost.c vhost: add external message handling to the API 2019-02-08 19:27:07 +01:00
vhost.h vhost: add external message handling to the API 2019-02-08 19:27:07 +01:00
virtio_crypto.h vhost: add virtio crypto header file 2018-04-14 00:43:30 +02:00
virtio_net.c vhost: fix access for indirect descriptors 2019-01-24 10:08:31 +01:00