Files
linux/net/vmw_vsock
Stefano Garzarella 3a3e3d90cb vsock/virtio: fix empty payload in tap skb for non-linear buffers
For non-linear skbs, virtio_transport_build_skb() goes through
virtio_transport_copy_nonlinear_skb() to copy the original payload
in the new skb to be delivered to the vsockmon tap device.
This manually initializes an iov_iter but does not set iov_iter.count.
Since the iov_iter is zero-initialized, the copy length is zero and no
payload is actually copied to the monitor interface, leaving data
un-initialized.

Fix this by removing the linear vs non-linear split and using
skb_copy_datagram_iter() with iov_iter_kvec() for all cases, as
vhost-vsock already does. This handles both linear and non-linear skbs,
properly initializes the iov_iter, and removes the now unused
virtio_transport_copy_nonlinear_skb().

While touching this code, let's also check the return value of
skb_copy_datagram_iter(), even though it's unlikely to fail.

Fixes: 4b0bf10eb0 ("vsock/virtio: non-linear skb handling for tap")
Reported-by: Yiqi Sun <[email protected]>
Signed-off-by: Stefano Garzarella <[email protected]>
Reviewed-by: Bobby Eshleman <[email protected]>
Reviewed-by: Arseniy Krasnov <[email protected]>
Link: https://patch.msgid.link/[email protected]
Acked-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Paolo Abeni <[email protected]>
2026-05-12 12:52:15 +02:00
..
2026-04-29 17:30:45 -07:00
2023-03-29 08:19:38 +01:00