linux-yocto/net/vmw_vsock
Budimir Markovic cf86704798 vsock: Do not allow binding to VMADDR_PORT_ANY
commit aba0c94f61ec05315fa7815d21aefa4c87f6a9f4 upstream.

It is possible for a vsock to autobind to VMADDR_PORT_ANY. This can
cause a use-after-free when a connection is made to the bound socket.
The socket returned by accept() also has port VMADDR_PORT_ANY but is not
on the list of unbound sockets. Binding it will result in an extra
refcount decrement similar to the one fixed in fcdd2242c0 (vsock: Keep
the binding until socket destruction).

Modify the check in __vsock_bind_connectible() to also prevent binding
to VMADDR_PORT_ANY.

Fixes: d021c34405 ("VSOCK: Introduce VM Sockets")
Reported-by: Budimir Markovic <markovicbudimir@gmail.com>
Signed-off-by: Budimir Markovic <markovicbudimir@gmail.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Link: https://patch.msgid.link/20250807041811.678-1-markovicbudimir@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-08-28 16:24:14 +02:00
..
af_vsock_tap.c
af_vsock.c vsock: Do not allow binding to VMADDR_PORT_ANY 2025-08-28 16:24:14 +02:00
diag.c
hyperv_transport.c hv_sock: Initializing vsk->trans to NULL to prevent a dangling pointer 2024-11-14 13:13:42 +01:00
Kconfig
Makefile
virtio_transport_common.c vsock/virtio: discard packets if the transport changes 2025-01-23 17:16:03 +01:00
virtio_transport.c
vmci_transport_notify_qstate.c
vmci_transport_notify.c
vmci_transport_notify.h
vmci_transport.c vsock/vmci: Clear the vmci transport packet properly when initializing it 2025-07-10 15:57:42 +02:00
vmci_transport.h
vsock_addr.c
vsock_loopback.c