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 30918502D5A; Wed, 30 Sep 2026 18:19:16 +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=1790792357; cv=none; b=mK9jmor96Gc8FodD8lrukHckEq3LQ8omV4xr34e/Vf8ra0ih328Pu/gPbnTWWZ7MX32v1OB1QBbUwmPuNj8ZOrQ6Wz7VYZF8Xf4iuJe2XQpYi9wnLt4/N6GsMRiagP7UIlsxIiHxfwGGtZBZAXfZV5jGVCeEnHe361X4knPBcDk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790792357; c=relaxed/simple; bh=PuejBTbM5GgtVxfGKd8UuhBCFHeLS8+IlzMjXtPrwbQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=t8HYQLHvwBFYa1SV/L7tQlK+aIWkVNSJ6WlJsnFdutSccx25hyFdge3iUDK1+hj+x0l8KXR0uYMJWHzPeWCY3lcp5xygv9peRiWlmA9g5oIz/H1J7lsS13VaHAP7HcI3YDG0b7NCSZRQQc/JwjVjNjDkiAH6oOJNZ/e6RijonPE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=TilbfVJG; 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="TilbfVJG" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8536A1F000FF; Wed, 30 Sep 2026 18:19:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1790792356; bh=gCxFf3T7WN2IB69VTIrwqtK9geLadUZPNbFqsDgWifk=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=TilbfVJGxeh1Nnd6UjtCHs2uRbjUG+5oLsHDiUYY6rXkldCZL/4I13Jji+19tf2ki j+hJlDfH/fQagW7EEjJo//hhD/O7G0eurx55YpBZpvqS3FLVWdLvnTNwoptvrmWAvg 1k/tlg3tGtJmUSD1TkYIxLt85Yqikxc1bMGNplBs= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Yiqi Sun , Xin Long , Jakub Kicinski , Sasha Levin Subject: [PATCH 5.15 626/752] sctp: avoid livelock while updating retransmit path Date: Wed, 30 Sep 2026 17:28:16 +0200 Message-ID: <20260930152411.821013262@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260930152358.131179731@linuxfoundation.org> References: <20260930152358.131179731@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 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Yiqi Sun [ Upstream commit d2c31b837406395e576afeb25958c98e9938f3f6 ] sctp_assoc_update_retran_path() can loop forever when every remaining transport, including retran_path, is SCTP_UNCONFIRMED: the state check runs before the wraparound test, so the loop cannot observe that it has completed a full pass. Fix this by considering a transport only when it is not UNCONFIRMED, then checking whether the walk has returned to retran_path. This makes the full-pass termination independent of the transport state while preserving the existing fallback selection semantics. Also restore the NULL guard around the retran_path assignment. In the all-UNCONFIRMED case there is no eligible replacement transport, and installing NULL would leave later retransmit-path users and the debug print with a NULL path. Fixes: 4c47af4d5eb2 ("net: sctp: rework multihoming retransmission path selection to rfc4960") Signed-off-by: Yiqi Sun Acked-by: Xin Long Link: https://patch.msgid.link/20260915095017.942213-1-sunyiqixm@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- net/sctp/associola.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/net/sctp/associola.c b/net/sctp/associola.c index c141f8a1262df..a957142672cb2 100644 --- a/net/sctp/associola.c +++ b/net/sctp/associola.c @@ -1305,18 +1305,19 @@ void sctp_assoc_update_retran_path(struct sctp_association *asoc) /* Manually skip the head element. */ if (&trans->transports == &asoc->peer.transport_addr_list) continue; - if (trans->state == SCTP_UNCONFIRMED) - continue; - trans_next = sctp_trans_elect_best(trans, trans_next); - /* Active is good enough for immediate return. */ - if (trans_next->state == SCTP_ACTIVE) - break; + if (trans->state != SCTP_UNCONFIRMED) { + trans_next = sctp_trans_elect_best(trans, trans_next); + /* Active is good enough for immediate return. */ + if (trans_next->state == SCTP_ACTIVE) + break; + } /* We've reached the end, time to update path. */ if (trans == asoc->peer.retran_path) break; } - asoc->peer.retran_path = trans_next; + if (trans_next) + asoc->peer.retran_path = trans_next; pr_debug("%s: association:%p updated new path to addr:%pISpc\n", __func__, asoc, &asoc->peer.retran_path->ipaddr.sa); -- 2.53.0