Netdev List
 help / color / mirror / Atom feed
* [PATCH net v4 0/4] vsock/virtio: fix TX credit handling
@ 2025-12-17 18:12 Melbin K Mathew
  2025-12-17 18:12 ` [PATCH net v4 1/4] vsock/virtio: fix potential underflow in virtio_transport_get_credit() Melbin K Mathew
                   ` (4 more replies)
  0 siblings, 5 replies; 13+ messages in thread
From: Melbin K Mathew @ 2025-12-17 18:12 UTC (permalink / raw)
  To: stefanha, sgarzare
  Cc: kvm, netdev, virtualization, linux-kernel, mst, jasowang,
	xuanzhuo, eperezma, davem, edumazet, kuba, pabeni, horms,
	Melbin K Mathew

This series fixes TX credit handling in virtio-vsock:

Patch 1: Fix potential underflow in get_credit() using s64 arithmetic
Patch 2: Cap TX credit to local buffer size (security hardening)
Patch 3: Fix vsock_test seqpacket bounds test
Patch 4: Add stream TX credit bounds regression test

The core issue is that a malicious guest can advertise a huge buffer
size via SO_VM_SOCKETS_BUFFER_SIZE, causing the host to allocate
excessive sk_buff memory when sending data to that guest.

On an unpatched Ubuntu 22.04 host (~64 GiB RAM), running a PoC with
32 guest vsock connections advertising 2 GiB each and reading slowly
drove Slab/SUnreclaim from ~0.5 GiB to ~57 GiB; the system only
recovered after killing the QEMU process.

With this series applied, the same PoC shows only ~35 MiB increase in
Slab/SUnreclaim, no host OOM, and the guest remains responsive.
-- 
2.34.1

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2026-01-16 20:21 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-17 18:12 [PATCH net v4 0/4] vsock/virtio: fix TX credit handling Melbin K Mathew
2025-12-17 18:12 ` [PATCH net v4 1/4] vsock/virtio: fix potential underflow in virtio_transport_get_credit() Melbin K Mathew
2025-12-18  9:19   ` Stefano Garzarella
2025-12-17 18:12 ` [PATCH net v4 2/4] vsock/virtio: cap TX credit to local buffer size Melbin K Mathew
2025-12-18  9:24   ` Stefano Garzarella
2025-12-27 16:00   ` Paolo Abeni
2025-12-17 18:12 ` [PATCH net v4 3/4] vsock/test: fix seqpacket message bounds test Melbin K Mathew
2025-12-18  9:14   ` Stefano Garzarella
2025-12-17 18:12 ` [PATCH net v4 4/4] vsock/test: add stream TX credit " Melbin K Mathew
2025-12-18  9:45   ` Stefano Garzarella
2025-12-18  9:18 ` [PATCH net v4 0/4] vsock/virtio: fix TX credit handling Stefano Garzarella
2026-01-08 11:27   ` Stefano Garzarella
2026-01-16 20:21     ` Stefano Garzarella

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox