virtio_vdpa: reject invalid vq indices
authorVincent Whitchurch <vincent.whitchurch@axis.com>
Thu, 1 Jul 2021 11:46:52 +0000 (13:46 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 3 Sep 2021 08:09:27 +0000 (10:09 +0200)
commit6c074eaaf7855dfee8faa8a093940fff5e779ec3
tree613f44d0dbc50a0bad2e6225a17e426f0d221a5f
parent0698278e8eefb22660b6fa27b002b4232131c146
virtio_vdpa: reject invalid vq indices

[ Upstream commit cb5d2c1f6cc0e5769099a7d44b9d08cf58cae206 ]

Do not call vDPA drivers' callbacks with vq indicies larger than what
the drivers indicate that they support.  vDPA drivers do not bounds
check the indices.

Signed-off-by: Vincent Whitchurch <vincent.whitchurch@axis.com>
Link: https://lore.kernel.org/r/20210701114652.21956-1-vincent.whitchurch@axis.com
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/virtio/virtio_vdpa.c