]> git.baikalelectronics.ru Git - kernel.git/commit
vsock/virtio: discard packets if credit is not respected
authorStefano Garzarella <sgarzare@redhat.com>
Thu, 17 Oct 2019 12:44:03 +0000 (14:44 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 18 Oct 2019 17:19:43 +0000 (10:19 -0700)
commitdad069ab8f70651a0033770a54023030cdcc68d3
tree5fbcf9656666a376a80edc90c21a1de0da79e343
parentade4d3a5fd31846335843db8792b4821ed1c3cc1
vsock/virtio: discard packets if credit is not respected

If the remote peer doesn't respect the credit information
(buf_alloc, fwd_cnt), sending more data than it can send,
we should drop the packets to prevent a malicious peer
from using all of our memory.

This is patch follows the VIRTIO spec: "VIRTIO_VSOCK_OP_RW data
packets MUST only be transmitted when the peer has sufficient
free buffer space for the payload"

Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/vmw_vsock/virtio_transport_common.c