vhost-vdpa: Fix integer overflow in vhost_vdpa_process_iotlb_update()
authorXie Yongji <xieyongji@bytedance.com>
Wed, 28 Jul 2021 13:07:55 +0000 (21:07 +0800)
committerSasha Levin <sashal@kernel.org>
Thu, 26 Aug 2021 12:35:04 +0000 (08:35 -0400)
commit8a821b88b1a66c48f5ee8be1b39b6b4ff0cad1c6
treeaf5c59a40b421422030f1c4842fb7b57620f7ef4
parent6caaf9fcb7b4f808d73ca5aeb391bdf766a4dd04
vhost-vdpa: Fix integer overflow in vhost_vdpa_process_iotlb_update()

[ Upstream commit 0e398290cff997610b66e73573faaee70c9a700e ]

The "msg->iova + msg->size" addition can have an integer overflow
if the iotlb message is from a malicious user space application.
So let's fix it.

Fixes: 1b48dc03e575 ("vhost: vdpa: report iova range")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Xie Yongji <xieyongji@bytedance.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Link: https://lore.kernel.org/r/20210728130756.97-1-xieyongji@bytedance.com
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/vhost/vdpa.c