Patch "mptcp: SO_KEEPALIVE: fix getsockopt support" has been added to the 5.15-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

    mptcp: SO_KEEPALIVE: fix getsockopt support

to the 5.15-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:
     mptcp-so_keepalive-fix-getsockopt-support.patch
and it can be found in the queue-5.15 subdirectory.

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



commit 8ccde2540360b101b974e19711073cb268e894bc
Author: Matthieu Baerts (NGI0) <matttbe@xxxxxxxxxx>
Date:   Mon May 13 18:13:25 2024 -0700

    mptcp: SO_KEEPALIVE: fix getsockopt support
    
    [ Upstream commit a65198136eaa15b74ee0abf73f12ef83d469a334 ]
    
    SO_KEEPALIVE support has to be set on each subflow: on each TCP socket,
    where sk_prot->keepalive is defined. Technically, nothing has to be done
    on the MPTCP socket. That's why mptcp_sol_socket_sync_intval() was
    called instead of mptcp_sol_socket_intval().
    
    Except that when nothing is done on the MPTCP socket, the
    getsockopt(SO_KEEPALIVE), handled in net/core/sock.c:sk_getsockopt(),
    will not know if SO_KEEPALIVE has been set on the different subflows or
    not.
    
    The fix is simple: simply call mptcp_sol_socket_intval() which will end
    up calling net/core/sock.c:sk_setsockopt() where the SOCK_KEEPOPEN flag
    will be set, the one used in sk_getsockopt().
    
    So now, getsockopt(SO_KEEPALIVE) on an MPTCP socket will return the same
    value as the one previously set with setsockopt(SO_KEEPALIVE).
    
    Fixes: 1b3e7ede1365 ("mptcp: setsockopt: handle SO_KEEPALIVE and SO_PRIORITY")
    Acked-by: Paolo Abeni <pabeni@xxxxxxxxxx>
    Signed-off-by: Matthieu Baerts (NGI0) <matttbe@xxxxxxxxxx>
    Signed-off-by: Mat Martineau <martineau@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20240514011335.176158-2-martineau@xxxxxxxxxx
    Signed-off-by: Jakub Kicinski <kuba@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/net/mptcp/sockopt.c b/net/mptcp/sockopt.c
index 4bb305342fcc7..bd797d8f72ab1 100644
--- a/net/mptcp/sockopt.c
+++ b/net/mptcp/sockopt.c
@@ -177,8 +177,6 @@ static int mptcp_setsockopt_sol_socket_int(struct mptcp_sock *msk, int optname,
 
 	switch (optname) {
 	case SO_KEEPALIVE:
-		mptcp_sol_socket_sync_intval(msk, optname, val);
-		return 0;
 	case SO_DEBUG:
 	case SO_MARK:
 	case SO_PRIORITY:




[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