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 CD1A53F1AC4; Wed, 20 May 2026 17:08:55 +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=1779296936; cv=none; b=Es+a/EmHHaosyW/eykLzDDUjp70qeum/R9Nc5n5EQJC6Wt+2vfsZ08+AGlNG58a+SOejOpdaPhd8CsalkHS+NIbd+3cx2syY3gMvZ60eaFxXUrjTkMi4oFT7hVy7L/GX43p27BmFVterxKpOEbFFlxUVbVSSg65D5pnB4u6wVg0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779296936; c=relaxed/simple; bh=Qd5aBoXKULkP7X5mkCis4D8yAnkMi8dS8HTSV0SyB3I=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=FLkg9XTbL1vQ+vd88PG7Kg/7Le6lBV9c+75kwKkrn5YFtjSS9tQYymkYFIsVG0j1dMmmTyf6y9B0gw7Ea+ds/kSQ+R2sav42NipgNcpP6W5bZzQl2GEVpPtIBUfGRRxrj5uVrv7QB4OJpUIhgZmHBbVJttd/lM3e4qhux05HhCE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=F/gBcqt0; 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="F/gBcqt0" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 33E5F1F000E9; Wed, 20 May 2026 17:08:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1779296935; bh=0WetREYeWkbmlEvOoeo6IL1+Kq+TiaTngwhTbY/ieFg=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=F/gBcqt06J7srNBa7gzUohSyfofctLemttmEOKCPWb5t6JHWj8Net/8iiBTOPQKD1 Ft91GvI8ZoJHJau/TIDQWZOzI0Hih92rCPCinUDfGRFG8TrQpglqc0+VpZ7efBu/VB KWmfwr+ZawJBLRz5+kcFx7XNsT2Tr/agN0DQTzfc= 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 7.0 0987/1146] sctp: discard stale INIT after handshake completion Date: Wed, 20 May 2026 18:20:37 +0200 Message-ID: <20260520162210.570378026@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260520162148.390695140@linuxfoundation.org> References: <20260520162148.390695140@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 7.0-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 7b823d7591419..8e89a870780c4 100644 --- a/net/sctp/sm_statefuns.c +++ b/net/sctp/sm_statefuns.c @@ -1556,6 +1556,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