+2
−1
Loading
In function vhost_dev_unregister, before removing vdev from the global linked list g_vhost_devices, other threads may access vdev member but some of them have been free at this time, causing uaf. E.g. When live migration, destroy_connection may access vdev->ctxt by vhost_session_find_by_vid at the same time. So we use spdk_vhost_lock to prevent other threads from accessing vdev members(e.g. user_dev(ctxt), name, path) which have been free. Change-Id: I81cc91633770c6b08f36b43545ed57cbb309aa01 Signed-off-by:Haoqian He <haoqian.he@smartx.com> Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/20273 Community-CI: Mellanox Build Bot Reviewed-by:
Changpeng Liu <changpeng.liu@intel.com> Reviewed-by:
Jim Harris <jim.harris@samsung.com> Tested-by:
SPDK CI Jenkins <sys_sgci@intel.com>