projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a1eb03f
)
vhost/net: length miscalculation
author
Michael S. Tsirkin
<
[email protected]
>
Wed, 7 Jan 2015 08:51:00 +0000
(10:51 +0200)
committer
Michael S. Tsirkin
<
[email protected]
>
Wed, 7 Jan 2015 10:22:00 +0000
(12:22 +0200)
commit
8b38694a2dc8b18374310df50174f1e4376d6824
vhost/net: virtio 1.0 byte swap
had this chunk:
- heads[headcount - 1].len += datalen;
+ heads[headcount - 1].len = cpu_to_vhost32(vq, len - datalen);
This adds datalen with the wrong sign, causing guest panics.
Fixes: 8b38694a2dc8b18374310df50174f1e4376d6824
Reported-by: Alex Williamson <
[email protected]
>
Suggested-by: Greg Kurz <
[email protected]
>
Signed-off-by: Michael S. Tsirkin <
[email protected]
>
drivers/vhost/net.c
patch
|
blob
|
history
diff --git
a/drivers/vhost/net.c
b/drivers/vhost/net.c
index 14419a8ccbb6b138aa8bd38b7765166c1f4aa398..d415d69dc2378cbc7568bbcdcc53e601770ee761 100644
(file)
--- a/
drivers/vhost/net.c
+++ b/
drivers/vhost/net.c
@@
-538,7
+538,7
@@
static int get_rx_bufs(struct vhost_virtqueue *vq,
++headcount;
seg += in;
}
- heads[headcount - 1].len = cpu_to_vhost32(vq, len
-
datalen);
+ heads[headcount - 1].len = cpu_to_vhost32(vq, len
+
datalen);
*iovcount = seg;
if (unlikely(log))
*log_num = nlogs;