From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 4494C2F90E0; Sat, 30 May 2026 18:11:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780164682; cv=none; b=bdhWIP1gHM90LHfzeGme4r05yS1GphLtlXEBSzkqcHoreJXDI9Ko8BNUmsG1ICLBx4xra8JJZkFIJ1tvQaQBlMs8tsfZxVHwozJjXTlKlynRk++vcNas9LssvCT+VBiW2CkhS/JmpCX41vAWeyZTFzIxmSc8C+88QdpndgGUz4o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780164682; c=relaxed/simple; bh=6rYPAtfCdeqoyEn3BfolYc2Bk980i6JMAYY4DkZckuA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=tmj590AoBdR+3As/lv/F5Ruf3wjQ1ytF2HS4BjNup6B3cM8rGOigDLZdc4DWdu6yQbri5yO7GxpB0m6mPw3wqPH3kGFEk2nlLmNrln8Dc6xU7quF1eujste26LACtNc70seUEII9igrnRbkb67Fj+gU3bD9GsiYGCx1aXUFMPW0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=y54OxOSt; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="y54OxOSt" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 874921F00893; Sat, 30 May 2026 18:11:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1780164681; bh=b+JTQYMjZBvJ1DQpc8AFOl/P2MApl6LLBu71iYyfIPg=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=y54OxOStDX2IVYOq6O4/w6cYzLqzXQmT2DFqnHxcPtWWDyIMJXAyMJiifZktQTMOe em8HPCtuVb9myBHhSZXvYcE591OwyVwgZtjp+Xqz8PdtizELhSne+dIEIKqqbP7itB 3d7+0M8/tSHuKtEO0UZDzcpskPeZl+XZOyhSQ+3E= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Xin Long , Marcelo Ricardo Leitner , Jakub Kicinski , Sasha Levin Subject: [PATCH 5.15 628/776] sctp: discard stale INIT after handshake completion Date: Sat, 30 May 2026 18:05:42 +0200 Message-ID: <20260530160256.202508660@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260530160240.228940103@linuxfoundation.org> References: <20260530160240.228940103@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Xin Long [ Upstream commit 8a92cb475ca90d84db769e4d4383e631ace0d6e5 ] After an association reaches ESTABLISHED, the peer’s init_tag is already known from the handshake. Any subsequent INIT with the same init_tag is not a valid restart, but a delayed or duplicate INIT. Drop such INIT chunks in sctp_sf_do_unexpected_init() instead of processing them as new association attempts. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Xin Long Acked-by: Marcelo Ricardo Leitner Link: https://patch.msgid.link/5788c76c1ee122a3ed00189e88dcf9df1fba226c.1777214801.git.lucien.xin@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- net/sctp/sm_statefuns.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c index dc758ad0051e0..2f9f24b188520 100644 --- a/net/sctp/sm_statefuns.c +++ b/net/sctp/sm_statefuns.c @@ -1555,6 +1555,12 @@ static enum sctp_disposition sctp_sf_do_unexpected_init( /* Tag the variable length parameters. */ chunk->param_hdr.v = skb_pull(chunk->skb, sizeof(struct sctp_inithdr)); + if (asoc->state >= SCTP_STATE_ESTABLISHED) { + /* Discard INIT matching peer vtag after handshake completion (stale INIT). */ + if (ntohl(chunk->subh.init_hdr->init_tag) == asoc->peer.i.init_tag) + return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); + } + /* Verify the INIT chunk before processing it. */ err_chunk = NULL; if (!sctp_verify_init(net, ep, asoc, chunk->chunk_hdr->type, -- 2.53.0