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 98D1244239E; Mon, 17 Aug 2026 15:24:48 +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=1786980289; cv=none; b=OroQKt+qxtYMjI6GBdeCgwHMDmFcvBzsG0H+A6Kmhf//UW67x8R2YwtVcbTaA2XuFan3/1ALxHkYG1OQ+PITZos+a14Qj5FyJLGszvVJDu+3xeci0NcSnLwv1X0rCA0tCc5miQecfw5VpfWyXJ5l70vXqyQi4cZQ3f65k7tn7so= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786980289; c=relaxed/simple; bh=rP3VUhi3w5/DnNXaAWxciSck6JMwAiNsuZK11XfsmnM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=TOwWrZa9NiNmQ9MQDF/QNubGnGEPnsuXkTu8TLMgOimSzH6YM7WGDc8QpfF4pGMqHyl79rAoA0I8LjKzbXw6mmw8zYXCTb88p4rUPJ7sFq2tSvJEp4WdFbyzWAc0lp11JjEXUWmPHGWDPdh0ul9kGYkmmoEd/XODpfAzT10W10Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=X+ySFysK; 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="X+ySFysK" Received: by smtp.kernel.org (Postfix) with ESMTPSA id BD5161F00ADB; Mon, 17 Aug 2026 15:24:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1786980288; bh=KKLWHFKL77zF9euU2vPYEyAiPjasMIN/uZ6K14lLKUE=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=X+ySFysK2EeFdCWwVQ+kqjY86js+YhSH2c0qj+sMUQMncm7OxxyKCzWObdm656mHQ d6h8HLwlZTOUR+h6fhGxz4iLMYTv9YuubpkGwZ81BMoAqsbhBz96MGJzi9NA3nTVku 6rGvnaBiWYMHjyquh5ALb8MUeECSHhrxRlUzvBbs= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Qing Luo , Xin Long , Jakub Kicinski , Sasha Levin Subject: [PATCH 6.1 520/609] sctp: fix addip_serial increment on ASCONF_ACK allocation failure Date: Mon, 17 Aug 2026 15:33:36 +0200 Message-ID: <20260817132601.227536301@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260817132543.039278408@linuxfoundation.org> References: <20260817132543.039278408@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-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Qing Luo [ Upstream commit aa2e13ae8d3cbe2c15ef4f7e971b2de0832794aa ] In sctp_process_asconf(), when sctp_make_asconf_ack() fails to allocate the ASCONF_ACK chunk due to memory pressure, the code jumps to the done label where asoc->peer.addip_serial is unconditionally incremented. This leaves the peer's ASCONF (serial N) unacknowledged while the local endpoint now expects serial N+1. When the peer retransmits serial N, it falls into the serial < addip_serial + 1 branch , which attempts to look up a cached ACK for serial N. No cached ACK exists since the allocation failed, so the retransmission is silently discarded. The peer eventually times out and ABORTs the association. Move the addip_serial increment inside the if (asconf_ack) block so that the serial number is only advanced when the ASCONF_ACK is successfully created and cached. This way, on allocation failure, the serial number is unchanged and the peer's retransmitted ASCONF will be correctly re-processed. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Qing Luo Acked-by: Xin Long Link: https://patch.msgid.link/20260804025514.241767-1-l1138897701@163.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- net/sctp/sm_make_chunk.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c index 837fb8280bfd5..6d738f95aff1d 100644 --- a/net/sctp/sm_make_chunk.c +++ b/net/sctp/sm_make_chunk.c @@ -3362,12 +3362,11 @@ struct sctp_chunk *sctp_process_asconf(struct sctp_association *asoc, goto done; } done: - asoc->peer.addip_serial++; - /* If we are sending a new ASCONF_ACK hold a reference to it in assoc * after freeing the reference to old asconf ack if any. */ if (asconf_ack) { + asoc->peer.addip_serial++; sctp_chunk_hold(asconf_ack); list_add_tail(&asconf_ack->transmitted_list, &asoc->asconf_ack_list); -- 2.53.0