vhost: reject zero size iova range
authorJason Wang <jasowang@redhat.com>
Tue, 9 Apr 2019 04:10:25 +0000 (12:10 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 27 Apr 2019 07:34:40 +0000 (09:34 +0200)
commitc5bbedac8a3315aaa1951df8cf85da7527b55313
tree0fcac9209072e3742e158638050cd3f4fe90a62a
parent8530cf625d2139dea4598048157faa80952fa7e2
vhost: reject zero size iova range

[ Upstream commit 813dbeb656d6c90266f251d8bd2b02d445afa63f ]

We used to accept zero size iova range which will lead a infinite loop
in translate_desc(). Fixing this by failing the request in this case.

Reported-by: syzbot+d21e6e297322a900c128@syzkaller.appspotmail.com
Fixes: 6b1e6cc7 ("vhost: new device IOTLB API")
Signed-off-by: Jason Wang <jasowang@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/vhost/vhost.c