Skip to content

Commit 0d4a3f2

Browse files
committed
Revert "vhost: block speculation of translated descriptors"
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: [email protected] Signed-off-by: Michael S. Tsirkin <[email protected]>
1 parent 060423b commit 0d4a3f2

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/vhost/vhost.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2071,10 +2071,8 @@ static int translate_desc(struct vhost_virtqueue *vq, u64 addr, u32 len,
20712071
_iov = iov + ret;
20722072
size = node->size - addr + node->start;
20732073
_iov->iov_len = min((u64)len - s, size);
2074-
_iov->iov_base = (void __user *)
2075-
((unsigned long)node->userspace_addr +
2076-
array_index_nospec((unsigned long)(addr - node->start),
2077-
node->size));
2074+
_iov->iov_base = (void __user *)(unsigned long)
2075+
(node->userspace_addr + addr - node->start);
20782076
s += size;
20792077
addr += size;
20802078
++ret;

0 commit comments

Comments
 (0)