Skip to content

Commit

Permalink
Revert "vhost: block speculation of translated descriptors"
Browse files Browse the repository at this point in the history
This reverts commit a89db44.

I was hasty to include this patch, and it breaks the build on 32 bit.
Defence in depth is good but let's do it properly.

Cc: stable@vger.kernel.org
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
  • Loading branch information
Michael S. Tsirkin committed Sep 14, 2019
1 parent 060423b commit 0d4a3f2
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/vhost/vhost.c
Original file line number Diff line number Diff line change
Expand Up @@ -2071,10 +2071,8 @@ static int translate_desc(struct vhost_virtqueue *vq, u64 addr, u32 len,
_iov = iov + ret;
size = node->size - addr + node->start;
_iov->iov_len = min((u64)len - s, size);
_iov->iov_base = (void __user *)
((unsigned long)node->userspace_addr +
array_index_nospec((unsigned long)(addr - node->start),
node->size));
_iov->iov_base = (void __user *)(unsigned long)
(node->userspace_addr + addr - node->start);
s += size;
addr += size;
++ret;
Expand Down

0 comments on commit 0d4a3f2

Please sign in to comment.