Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3521197pxf; Mon, 15 Mar 2021 11:24:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJypaTEbZxTMjU95l0J0RScnhzv195C+WDL2udgISr4rSc91OaDFShYFpVhpvdj1j3YWz8Dw X-Received: by 2002:a17:906:874f:: with SMTP id hj15mr24811616ejb.404.1615832647875; Mon, 15 Mar 2021 11:24:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615832647; cv=none; d=google.com; s=arc-20160816; b=CATjzYqqM2TK3EuamvYrt7mDvybabx23Dg1kHY9U5M/NW+hJRIcKEH/ek9ADAz5A9z FurvvS+vAMCxoyBRl2fszcLzf0uCoDU/i/OmasK1tfnvRqLiFlnE7K4v6Gzzkz9G7obh NSY0IaDYI0aXxeHgu8F2tfrzgQjq8F82ZasySnb/8W+Hgez/jlPs6EHkJJ2Dnf+Zxsu5 yOZUHhN2EVcZjzb0zgg2kl1+xsuhYeBaaXirXNR7RVVzzOZy/MnQIkkMcKlH/9o0IowI TlcW6dq0smuCu8E84A2mG/6+3SMmRifIl+AwQKVycC4hosKqPb0mje/Jqe9wAMdZABWV JHyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ILxkHycrWChdo8DAZfimX7CKW1be7IXy2raRM8WNv48=; b=rf8pnGt9gaW105OiYkLPdNT8sSOb4XALgvx2TiYZj+JLVbHt41uZY0YY7NDdgsS4Xg my14OZO1FinY154FiTR4VkuaqVAXOvmcJuQfy+aY9+4DbqwZRCsksjzDF1V0pW9WEcOw 7YPB74OTTVEXmN63UJcYV2R37IOlRZu1a9V1HwRbwuCDI7hh/emBvEBaEWHjKEqRplWQ FCVuK1i1zPOffG7WLhxzuXzgSCfQ2icvdzZbMY5KmHXPRkeK0sdNZs6IxrIZbslD6tEJ ynBNT/AFFBautN1XMRZwvyBwNsSTWTZliElG3njh//F71V75wwxPhKTsa+L5wWr78mbO xg7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=0ubnHyNR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n19si11617022edq.224.2021.03.15.11.23.44; Mon, 15 Mar 2021 11:24:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=0ubnHyNR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238579AbhCOOX3 (ORCPT + 99 others); Mon, 15 Mar 2021 10:23:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:37522 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231678AbhCOOAE (ORCPT ); Mon, 15 Mar 2021 10:00:04 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 65AA464F3C; Mon, 15 Mar 2021 13:59:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816785; bh=oBaedW3ZVe/rOPk/x+o8rsGxTTvVfmgAc0nw/CuGuZ4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0ubnHyNR6qqmqfn6tBOSblPAXsDBNOv1WNHr0zdRgWSqlNXZK6/JTfRzhgHWvJl/9 Wh3rPYQm6V3uwWekPaSUfjtF+lIAUbmFgFvAPZRBbSGAzEKFCVuclzxB+pfiNbEGxE 8H1IBStNNFR+tJ8K+FL6CLcvwT20eawN1/g7hsKE= From: gregkh@linuxfoundation.org To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christoph Paasch , Paolo Abeni , Matthieu Baerts , Florian Westphal , Mat Martineau , "David S. Miller" , Sasha Levin Subject: [PATCH 5.11 123/306] mptcp: reset last_snd on subflow close Date: Mon, 15 Mar 2021 14:53:06 +0100 Message-Id: <20210315135511.830130427@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210315135507.611436477@linuxfoundation.org> References: <20210315135507.611436477@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Greg Kroah-Hartman From: Florian Westphal [ Upstream commit e0be4931f3fee2e04dec4013ea4f27ec2db8556f ] Send logic caches last active subflow in the msk, so it needs to be cleared when the cached subflow is closed. Fixes: d5f49190def61c ("mptcp: allow picking different xmit subflows") Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/155 Reported-by: Christoph Paasch Acked-by: Paolo Abeni Reviewed-by: Matthieu Baerts Signed-off-by: Florian Westphal Signed-off-by: Mat Martineau Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- net/mptcp/protocol.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c index 3cc7be259396..de89824a2a36 100644 --- a/net/mptcp/protocol.c +++ b/net/mptcp/protocol.c @@ -2110,6 +2110,8 @@ static struct sock *mptcp_subflow_get_retrans(const struct mptcp_sock *msk) void __mptcp_close_ssk(struct sock *sk, struct sock *ssk, struct mptcp_subflow_context *subflow) { + struct mptcp_sock *msk = mptcp_sk(sk); + list_del(&subflow->node); lock_sock_nested(ssk, SINGLE_DEPTH_NESTING); @@ -2138,6 +2140,9 @@ void __mptcp_close_ssk(struct sock *sk, struct sock *ssk, release_sock(ssk); sock_put(ssk); + + if (ssk == msk->last_snd) + msk->last_snd = NULL; } static unsigned int mptcp_sync_mss(struct sock *sk, u32 pmtu) -- 2.30.1