]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
vhost-vdpa: protect concurrent access to vhost device iotlb
authorXie Yongji <xieyongji@bytedance.com>
Mon, 12 Apr 2021 09:55:12 +0000 (17:55 +0800)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 7 May 2021 07:54:09 +0000 (09:54 +0200)
commit940f67a00529b8a70dfeb6c6e20b1082afb03a3d
tree4130dae0f8ed8b2b8b64c70f8d3c9547e1a9db1e
parenta342bb9a3d435acd9ddb57d2d5818b81c69ee256
vhost-vdpa: protect concurrent access to vhost device iotlb

BugLink: https://bugs.launchpad.net/bugs/1927535
commit a9d064524fc3cf463b3bb14fa63de78aafb40dab upstream.

Protect vhost device iotlb by vhost_dev->mutex. Otherwise,
it might cause corruption of the list and interval tree in
struct vhost_iotlb if userspace sends the VHOST_IOTLB_MSG_V2
message concurrently.

Fixes: 4c8cf318("vhost: introduce vDPA-based backend")
Cc: stable@vger.kernel.org
Signed-off-by: Xie Yongji <xieyongji@bytedance.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Link: https://lore.kernel.org/r/20210412095512.178-1-xieyongji@bytedance.com
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
drivers/vhost/vdpa.c