From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5D81717727; Mon, 27 May 2024 19:31:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716838261; cv=none; b=XSAWcdkztM3+8+343mluH7LH6xHeHofulH1+uOfiOR6Vr3zWlCOdmBig3HfegGdQ5T+pvd3ZgeFVcjaRC/TMCnMXDlp4b8TfuEH/sMUQnRrWn7KYQIPVNcRRqyt/SMk4s1GCe/b5ALYmspinN+bIqHSwZbSSxmKYXfpxNk1SkQo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716838261; c=relaxed/simple; bh=C79zcChW4IEkc/AjsOnAK+uQLRFdFbTvp90z7fqYmWs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=a5HhxTaOWUjML2F18dv9hVh5P9ad5vTfCjQLe0w4f4qGh7Ye+xBzaJrAQoBj3gjValnVfTAZj6mqXq2Qw69PeI5/TbLM8WHoax7O+B8X9zftLkjF7Whs1m6tfgRfXrV6N67yP9qtwqScqjpHkFpBQ1pZs5WgfesaNxSDbdMo8uc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=WG/N8kCi; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="WG/N8kCi" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8758FC2BBFC; Mon, 27 May 2024 19:31:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1716838261; bh=C79zcChW4IEkc/AjsOnAK+uQLRFdFbTvp90z7fqYmWs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WG/N8kCiPlMNHnFAYiwLJzcyt6OwpNFwzV/ieZ+v++yShYdBNOkhWQZ5Qg5YfVLpE 9vSilOEU8fmbL1Ls/UWkucsvyq5mhvewAfsQhZooqzbw6TVsr14nT807Ok5+7Jj8+K Qg1DZVeMHdc61I+SgKkaU53wUDQ/IMiWl9yW1v4s= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Paolo Abeni , "Matthieu Baerts (NGI0)" , Mat Martineau , Jakub Kicinski , Sasha Levin Subject: [PATCH 6.8 326/493] mptcp: SO_KEEPALIVE: fix getsockopt support Date: Mon, 27 May 2024 20:55:28 +0200 Message-ID: <20240527185640.925570087@linuxfoundation.org> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240527185626.546110716@linuxfoundation.org> References: <20240527185626.546110716@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.8-stable review patch. If anyone has any objections, please let me know. ------------------ From: Matthieu Baerts (NGI0) [ 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 Signed-off-by: Matthieu Baerts (NGI0) Signed-off-by: Mat Martineau Link: https://lore.kernel.org/r/20240514011335.176158-2-martineau@kernel.org Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- net/mptcp/sockopt.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/net/mptcp/sockopt.c b/net/mptcp/sockopt.c index ef3edba754a32..f361d02f94b7e 100644 --- a/net/mptcp/sockopt.c +++ b/net/mptcp/sockopt.c @@ -181,8 +181,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: -- 2.43.0