Patch "vsock: Allow retrying on connect() failure" has been added to the 5.10-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    vsock: Allow retrying on connect() failure

to the 5.10-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     vsock-allow-retrying-on-connect-failure.patch
and it can be found in the queue-5.10 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 5e03a66d55db154f0f27f4d07f518782fe99db15
Author: Michal Luczaj <mhal@xxxxxxx>
Date:   Tue Jan 28 14:15:28 2025 +0100

    vsock: Allow retrying on connect() failure
    
    [ Upstream commit aa388c72113b7458127b709bdd7d3628af26e9b4 ]
    
    sk_err is set when a (connectible) connect() fails. Effectively, this makes
    an otherwise still healthy SS_UNCONNECTED socket impossible to use for any
    subsequent connection attempts.
    
    Clear sk_err upon trying to establish a connection.
    
    Fixes: d021c344051a ("VSOCK: Introduce VM Sockets")
    Reviewed-by: Stefano Garzarella <sgarzare@xxxxxxxxxx>
    Reviewed-by: Luigi Leonardi <leonardi@xxxxxxxxxx>
    Signed-off-by: Michal Luczaj <mhal@xxxxxxx>
    Link: https://patch.msgid.link/20250128-vsock-transport-vs-autobind-v3-2-1cf57065b770@xxxxxxx
    Signed-off-by: Jakub Kicinski <kuba@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c
index 53a9c0a73489b..473ba765a4356 100644
--- a/net/vmw_vsock/af_vsock.c
+++ b/net/vmw_vsock/af_vsock.c
@@ -1340,6 +1340,11 @@ static int vsock_stream_connect(struct socket *sock, struct sockaddr *addr,
 		if (err < 0)
 			goto out;
 
+		/* sk_err might have been set as a result of an earlier
+		 * (failed) connect attempt.
+		 */
+		sk->sk_err = 0;
+
 		/* Mark sock as connecting and set the error code to in
 		 * progress in case this is a non-blocking connect.
 		 */




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux