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 45D953F44DA; Fri, 15 May 2026 16:08:42 +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=1778861322; cv=none; b=rK6LNsOIlBIt+Orz3sPoZGC7kj2I+UXg2RGRZEW6IY8INRntmF12GfyngjSCT5PyrQaJJHDf7oWphNU/LHcLb9SnFDqPs7mK9tNM+f3xpXyBojMsIvI/AnigHWu6SgK2CzlaSIvP6lYUmr36rgWGGmW3L7H59qiMW895EhK86b4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778861322; c=relaxed/simple; bh=W5WTlcNrzUarW0M65Gue1zSyNtLn0JrzITVsGByj9m4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=VKWzAHw26/DX7Fkzk6Pyfd/kYkrGzKEIZUoh5RQal4mW3KMbKJMA/Jf4E9Yd7f8u0aM+yW+LcQECUEUnI7NK0XfqigpOJS73SVBPJckU6pAMOwK6c4D6OqCLIJku0RZoUy4JrhvWLrmp/Eg6PpPbEsfweqVNfKnKY9G1y8GFGIk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=ZP5twIDX; 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="ZP5twIDX" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C8B1BC2BCB0; Fri, 15 May 2026 16:08:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1778861322; bh=W5WTlcNrzUarW0M65Gue1zSyNtLn0JrzITVsGByj9m4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZP5twIDXS3mmCpzuvLfiVL/fs0nY1nLTO0j2rptaFjLf+bbWQEaAA0M7AeYLpFCSu cUq71S+TGPZQmQvqFs2Cs9SbB2GCDpwo0Q5ZGCLIw+e4OF+HaWZaNNUqxmOzJP1tUe 2qTkQYt7z6d4GXPX2DcG0q/m+Q55Nl1OCZgej8JE= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Lance Tuller , Mat Martineau , "Matthieu Baerts (NGI0)" , Jakub Kicinski Subject: [PATCH 6.6 283/474] mptcp: fastclose msk when linger time is 0 Date: Fri, 15 May 2026 17:46:32 +0200 Message-ID: <20260515154721.125159435@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260515154715.053014143@linuxfoundation.org> References: <20260515154715.053014143@linuxfoundation.org> User-Agent: quilt/0.69 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.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Matthieu Baerts (NGI0) commit f14d6e9c3678a067f304abba561e0c5446c7e845 upstream. The SO_LINGER socket option has been supported for a while with MPTCP sockets [1], but it didn't cause the equivalent of a TCP reset as expected when enabled and its time was set to 0. This was causing some behavioural differences with TCP where some connections were not promptly stopped as expected. To fix that, an extra condition is checked at close() time before sending an MP_FASTCLOSE, the MPTCP equivalent of a TCP reset. Note that backporting up to [1] will be difficult as more changes are needed to be able to send MP_FASTCLOSE. It seems better to stop at [2], which was supposed to already imitate TCP. Validated with MPTCP packetdrill tests [3]. Fixes: 268b12387460 ("mptcp: setsockopt: support SO_LINGER") [1] Fixes: d21f83485518 ("mptcp: use fastclose on more edge scenarios") [2] Cc: stable@vger.kernel.org Reported-by: Lance Tuller Closes: https://github.com/lance0/xfr/pull/67 Link: https://github.com/multipath-tcp/packetdrill/pull/196 [3] Reviewed-by: Mat Martineau Signed-off-by: Matthieu Baerts (NGI0) Link: https://patch.msgid.link/20260427-net-mptcp-misc-fixes-7-1-rc2-v1-3-7432b7f279fa@kernel.org Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- net/mptcp/protocol.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/net/mptcp/protocol.c +++ b/net/mptcp/protocol.c @@ -3177,7 +3177,8 @@ bool __mptcp_close(struct sock *sk, long goto cleanup; } - if (mptcp_data_avail(msk) || timeout < 0) { + if (mptcp_data_avail(msk) || timeout < 0 || + (sock_flag(sk, SOCK_LINGER) && !sk->sk_lingertime)) { /* If the msk has read data, or the caller explicitly ask it, * do the MPTCP equivalent of TCP reset, aka MPTCP fastclose */