> When vhost_transport_do_send_pkt() fails to deliver a packet to the guest
> (unexpected output buffers, a buffer smaller than the header, a fault
> while copying the header or the payload) it frees the skb with
> kfree_skb() and gives up. The success path does more:
> virtio_transport_consume_skb_sent() subtracts the payload from the
> socket's bytes_unsent (SIOCOUTQ), and for a reply the queued_replies
> counter is decremented, restarting the guest's tx queue once it drops
> below the ring size.
>
> The error paths skip both. Every such drop leaves SIOCOUTQ too high for
> the life of the socket, and every dropped reply permanently takes one
> slot of the queued_replies budget, so that after a ring's worth of them
> vhost stops processing the guest's tx queue for good.
>
> Release both on the error paths, as the success path does.
>
> Fixes: 433fc58e6bf2 ("VSOCK: Introduce vhost_vsock.ko")
> Fixes: e6ab45005772 ("vsock/virtio: add SIOCOUTQ support for all virtio based
> transports")
> Signed-off-by: Oleg Drokin <[email protected]>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review ยท
https://sashiko.dev/#/patchset/[email protected]?part=1