Re: [PATCH] vhost/net: length miscalculation

2015-01-08 Thread Michael S. Tsirkin
On Wed, Jan 07, 2015 at 11:58:00PM +0300, Sergei Shtylyov wrote: Hello. On 01/07/2015 11:55 AM, Michael S. Tsirkin wrote: commit 8b38694a2dc8b18374310df50174f1e4376d6824 vhost/net: virtio 1.0 byte swap had this chunk: - heads[headcount - 1].len += datalen; +

[PATCH] vhost/net: length miscalculation

2015-01-07 Thread Michael S. Tsirkin
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:

Re: [PATCH] vhost/net: length miscalculation

2015-01-07 Thread Sergei Shtylyov
Hello. On 01/07/2015 11:55 AM, Michael S. Tsirkin wrote: 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

Re: [PATCH] vhost/net: length miscalculation

2015-01-07 Thread Alex Williamson
On Wed, 2015-01-07 at 10:55 +0200, Michael S. Tsirkin wrote: 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