VSOCK: Send reset control packet when socket is partially bound
authorJorgen Hansen <jhansen@vmware.com>
Tue, 18 Dec 2018 08:34:06 +0000 (00:34 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 9 Jan 2019 16:14:45 +0000 (17:14 +0100)
commit80f098070a63222f68f7f92262abfbdf5c4bc4a1
treec2cee6984c519582fdfb9d5de747834097d8bd03
parent2510d91bdafe6ebe95864290866bb6c3e714b6e8
VSOCK: Send reset control packet when socket is partially bound

[ Upstream commit a915b982d8f5e4295f64b8dd37ce753874867e88 ]

If a server side socket is bound to an address, but not in the listening
state yet, incoming connection requests should receive a reset control
packet in response. However, the function used to send the reset
silently drops the reset packet if the sending socket isn't bound
to a remote address (as is the case for a bound socket not yet in
the listening state). This change fixes this by using the src
of the incoming packet as destination for the reset packet in
this case.

Fixes: d021c344051a ("VSOCK: Introduce VM Sockets")
Reviewed-by: Adit Ranadive <aditr@vmware.com>
Reviewed-by: Vishnu Dasa <vdasa@vmware.com>
Signed-off-by: Jorgen Hansen <jhansen@vmware.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/vmw_vsock/vmci_transport.c