]> git.baikalelectronics.ru Git - kernel.git/commit
vhost/net: length miscalculation
authorMichael S. Tsirkin <mst@redhat.com>
Wed, 7 Jan 2015 08:51:00 +0000 (10:51 +0200)
committerMichael S. Tsirkin <mst@redhat.com>
Wed, 7 Jan 2015 10:22:00 +0000 (12:22 +0200)
commit6473ab98a81ad60d208cc1c8ddeb350a1314aa86
treecd2c592b0eb4a69108029bfe64f79f657c4ef835
parentcc1e3b52814c1dc6b479b3da10b86a4b36eddd3a
vhost/net: length miscalculation

commit b08cf1b23a5573b6216bdf898aabe7ec6df6ed98
    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: b08cf1b23a5573b6216bdf898aabe7ec6df6ed98
Reported-by: Alex Williamson <alex.williamson@redhat.com>
Suggested-by: Greg Kurz <gkurz@linux.vnet.ibm.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
drivers/vhost/net.c