mirror of
https://github.com/torvalds/linux.git
synced 2026-09-23 13:14:02 +02:00
vmci_transport_recv_stream_cb() looks up sockets first by the full source
and destination tuple, then by destination only in the bound table. The
fallback can select a non-listening socket without checking whether the
packet came from its stored peer.
This was reproduced with two VMCI contexts. A RST from the context not
stored in a TCP_SYN_SENT socket reset that socket after it was selected by
the destination-only lookup.
VMCI can process notification packets in bottom-half context when the
socket is not owned by user context, or defer packets to a workqueue. Use
vsock_check_source() after taking the socket lock in the bottom-half path,
and recheck after lock_sock() in the workqueue path. Listening sockets
continue to accept packets from any source.
Reply with a RST addressed from the received packet before dropping a
source that fails validation. This preserves the existing reset behavior
for bound non-listening and concurrently closed sockets without directing
the reset to a connected socket's stored peer.
Fixes:
|
||
|---|---|---|
| .. | ||
| af_vsock_tap.c | ||
| af_vsock.c | ||
| diag.c | ||
| hyperv_transport.c | ||
| Kconfig | ||
| Makefile | ||
| virtio_transport_common.c | ||
| virtio_transport.c | ||
| vmci_transport_notify_qstate.c | ||
| vmci_transport_notify.c | ||
| vmci_transport_notify.h | ||
| vmci_transport.c | ||
| vmci_transport.h | ||
| vsock_addr.c | ||
| vsock_bpf.c | ||
| vsock_loopback.c | ||