All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net 0/2] vsock/virtio: fix MSG_PEEK calculation on bytes to copy
@ 2026-04-02  8:18 Luigi Leonardi
  2026-04-02  8:18 ` [PATCH net 1/2] vsock/virtio: fix MSG_PEEK ignoring skb offset when calculating " Luigi Leonardi
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Luigi Leonardi @ 2026-04-02  8:18 UTC (permalink / raw)
  To: Stefan Hajnoczi, Stefano Garzarella, Michael S. Tsirkin,
	Jason Wang, Xuan Zhuo, Eugenio Pérez, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Simon Horman,
	Arseniy Krasnov
  Cc: kvm, virtualization, netdev, linux-kernel, Luigi Leonardi

`virtio_transport_stream_do_peek`, when calculating the number of bytes to copy,
didn't consider the `offset`, caused by partial reads that happend before.
This might cause out-of-bounds read that lead to an EFAULT.
More details in the commit.

Commit 1 introduces the fix
Commit 2 introduces a test that checks for this bug to avoid future
regressions.

Signed-off-by: Luigi Leonardi <leonardi@redhat.com>
---
Luigi Leonardi (2):
      vsock/virtio: fix MSG_PEEK ignoring skb offset when calculating bytes to copy
      vsock/test: add MSG_PEEK after partial recv test

 net/vmw_vsock/virtio_transport_common.c |  5 ++-
 tools/testing/vsock/vsock_test.c        | 64 +++++++++++++++++++++++++++++++++
 2 files changed, 66 insertions(+), 3 deletions(-)
---
base-commit: 9147566d801602c9e7fc7f85e989735735bf38ba
change-id: 20260401-fix_peek-6837b83469e3

Best regards,
-- 
Luigi Leonardi <leonardi@redhat.com>


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

end of thread, other threads:[~2026-06-15 19:48 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-02  8:18 [PATCH net 0/2] vsock/virtio: fix MSG_PEEK calculation on bytes to copy Luigi Leonardi
2026-04-02  8:18 ` [PATCH net 1/2] vsock/virtio: fix MSG_PEEK ignoring skb offset when calculating " Luigi Leonardi
2026-04-02 13:08   ` Stefano Garzarella
2026-04-05 19:22   ` Arseniy Krasnov
2026-04-02  8:18 ` [PATCH net 2/2] vsock/test: add MSG_PEEK after partial recv test Luigi Leonardi
2026-04-02 13:28   ` Stefano Garzarella
2026-04-03 11:40     ` Luigi Leonardi
2026-04-05 19:14   ` Arseniy Krasnov
2026-04-07  8:45     ` Luigi Leonardi
2026-06-15 19:48 ` [PATCH net 0/2] vsock/virtio: fix MSG_PEEK calculation on bytes to copy Michael S. Tsirkin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.