]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
vsock/virtio: fix length and offset in tap skb for split packets
authorStefano Garzarella <sgarzare@redhat.com>
Fri, 8 May 2026 16:44:10 +0000 (18:44 +0200)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 12 May 2026 10:52:15 +0000 (12:52 +0200)
commit5f344d809e015fba3709e5219428c00b8ac5d7df
treeb643ca18e8cd182eee4f7397f19e46e78012febc
parent911f54771ca97947cfdca360e9e9b4147a330740
vsock/virtio: fix length and offset in tap skb for split packets

virtio_transport_build_skb() builds a new skb to be delivered to the
vsockmon tap device. To build the new skb, it uses the original skb
data length as payload length, but as the comment notes, the original
packet stored in the skb may have been split in multiple packets, so we
need to use the length in the header, which is correctly updated before
the packet is delivered to the tap, and the offset for the data.

This was also similar to what we did before commit 71dc9ec9ac7d
("virtio/vsock: replace virtio_vsock_pkt with sk_buff") where we probably
missed something during the skb conversion.

Also update the comment above, which was left stale by the skb
conversion and still mentioned a buffer pointer that no longer exists.

Fixes: 71dc9ec9ac7d ("virtio/vsock: replace virtio_vsock_pkt with sk_buff")
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Reviewed-by: Bobby Eshleman <bobbyeshleman@meta.com>
Reviewed-by: Arseniy Krasnov <avkrasnov@rulkc.org>
Link: https://patch.msgid.link/20260508164411.261440-2-sgarzare@redhat.com
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
net/vmw_vsock/virtio_transport_common.c