--- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c @@ -1649,6 +1649,8 @@ static int set_bit_to_user(int nr, void __user *addr) r = get_user_pages_fast(log, 1, 1, &page); if (r < 0) return r; + if (r == 0) + return -EFAULT; BUG_ON(r != 1); base = kmap_atomic(page); set_bit(bit, base);