]> 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)
commit7dd2b949d37bbafebd5fd721ee7a7b36f785fbbb
treecd2c592b0eb4a69108029bfe64f79f657c4ef835
parent0709da3133b39daa6d73b67c1e3c5c84d2c7ef5d
vhost/net: length miscalculation

commit 2de2f78b19076392377ba43ae813e5d7642820f6
    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: 2de2f78b19076392377ba43ae813e5d7642820f6
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