]> git.baikalelectronics.ru Git - kernel.git/commit
vhost: Fix the calculation in vhost_overflow()
authorXie Yongji <xieyongji@bytedance.com>
Wed, 28 Jul 2021 13:07:56 +0000 (21:07 +0800)
committerSasha Levin <sashal@kernel.org>
Thu, 26 Aug 2021 12:36:16 +0000 (08:36 -0400)
commit1d109912c6b2dc38be7cb10178662a8355688f85
treeb9a91eda61535a637b003bfd6efbcd17d08db935
parent40c009cd4bd46340ac01fbc1895621369ad7d1ff
vhost: Fix the calculation in vhost_overflow()

[ Upstream commit f7ad318ea0ad58ebe0e595e59aed270bb643b29b ]

This fixes the incorrect calculation for integer overflow
when the last address of iova range is 0xffffffff.

Fixes: 9ae11f321f6b ("vhost: detect 32 bit integer wrap around")
Reported-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Xie Yongji <xieyongji@bytedance.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Link: https://lore.kernel.org/r/20210728130756.97-2-xieyongji@bytedance.com
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/vhost/vhost.c