virtio/vsock: fix header length on skb merging
authorArseniy Krasnov <avkrasnov@sberdevices.ru>
Tue, 28 Mar 2023 11:31:28 +0000 (14:31 +0300)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 30 Mar 2023 08:47:48 +0000 (10:47 +0200)
commitf7154d967bc4ee25ea1572937550e711b2525474
treee093f2c8c014767a464b9c6cd3c4ffb88b9e3f41
parent209373537648d815a104c3af787663d7db06bd5d
virtio/vsock: fix header length on skb merging

This fixes appending newly arrived skbuff to the last skbuff of the
socket's queue. Problem fires when we are trying to append data to skbuff
which was already processed in dequeue callback at least once. Dequeue
callback calls function 'skb_pull()' which changes 'skb->len'. In current
implementation 'skb->len' is used to update length in header of the last
skbuff after new data was copied to it. This is bug, because value in
header is used to calculate 'rx_bytes'/'fwd_cnt' and thus must be not
be changed during skbuff's lifetime.

Bug starts to fire since:

commit 077706165717
("virtio/vsock: don't use skbuff state to account credit")

It presents before, but didn't triggered due to a little bit buggy
implementation of credit calculation logic. So use Fixes tag for it.

Fixes: 077706165717 ("virtio/vsock: don't use skbuff state to account credit")
Signed-off-by: Arseniy Krasnov <AVKrasnov@sberdevices.ru>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
net/vmw_vsock/virtio_transport_common.c