linux/net/vmw_vsock
Eiichi Tsukata b2d1b6624b vsock: prevent unnecessary refcnt inc for nonblocking connect
[ Upstream commit c7cd82b90599fa10915f41e3dd9098a77d0aa7b6 ]

Currently vosck_connect() increments sock refcount for nonblocking
socket each time it's called, which can lead to memory leak if
it's called multiple times because connect timeout function decrements
sock refcount only once.

Fixes it by making vsock_connect() return -EALREADY immediately when
sock state is already SS_CONNECTING.

Fixes: d021c34405 ("VSOCK: Introduce VM Sockets")
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Eiichi Tsukata <eiichi.tsukata@nutanix.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-11-17 09:48:48 +01:00
..
af_vsock_tap.c
af_vsock.c vsock: prevent unnecessary refcnt inc for nonblocking connect 2021-11-17 09:48:48 +01:00
diag.c
hyperv_transport.c vsock: fix locking in vsock_shutdown() 2021-02-17 10:35:19 +01:00
Kconfig
Makefile
virtio_transport_common.c vsock/virtio: update credit only if socket is not closed 2021-02-17 10:35:19 +01:00
virtio_transport.c vsock/virtio: avoid potential deadlock when vsock device remove 2021-08-18 08:57:01 +02:00
vmci_transport_notify_qstate.c
vmci_transport_notify.c
vmci_transport_notify.h
vmci_transport.c vsock/vmci: log once the failed queue pair allocation 2021-05-14 09:44:30 +02:00
vmci_transport.h
vsock_addr.c