vhost: reject zero size iova range
authorJason Wang <jasowang@redhat.com>
Tue, 9 Apr 2019 04:10:25 +0000 (12:10 +0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 11 Apr 2019 05:45:38 +0000 (22:45 -0700)
commit8b545118df365800f3a533f0d24bbe5515c66adc
tree24909b6cd09af83979b11b7e7b6f5b7cc2d2ba35
parent1b9b37303b058bde23e6ce63d8537cf5b8fc40c4
vhost: reject zero size iova range

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: ac35b123 ("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>
drivers/vhost/vhost.c