> The send credit is
> 
>     min(peer_buf_alloc, buf_alloc) - (tx_cnt - peer_fwd_cnt)
> 
> where peer_fwd_cnt is taken unchecked from every header the peer sends.
> A peer that never consumes what it is sent but keeps reporting
> fwd_cnt == tx_cnt gets unlimited credit: every send() is accepted and
> the skbs pile up in the transport's queue (on a host, vhost's
> send_pkt_queue, for a guest that posts no rx buffers). The skbs are
> GFP_KERNEL allocations charged to no memory cgroup. The peer learns
> tx_cnt easily when the host side relays a stream it also controls.
> 
> Commit 8ee784fdf006 ("vsock/virtio: cap TX credit to local buffer size")
> bounded peer_buf_alloc, but not peer_fwd_cnt.
> 
> [ ... ]
> (SIOCOUTQ 268304384, where the test stops); with this patch it stays at
> one window (SIOCOUTQ 262144).
> 
> Fixes: 06a8fc78367d ("VSOCK: Introduce virtio_vsock_common.ko")
> 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=2


Reply via email to