• Arseniy Krasnov's avatar
    virtio/vsock: fix header length on skb merging · f7154d96
    Arseniy Krasnov authored
    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 07770616
    ("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: 07770616 ("virtio/vsock: don't use skbuff state to account credit")
    Signed-off-by: default avatarArseniy Krasnov <AVKrasnov@sberdevices.ru>
    Reviewed-by: default avatarStefano Garzarella <sgarzare@redhat.com>
    Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
    f7154d96
virtio_transport_common.c 32.7 KB