🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: muc.lists.freebsd.bugs
Article #822

[Bug 301211] SCTP peer restart leaves ecn_echo_cnt_onq inconsistent with the control queue

#822
From: bugzilla-noreply
Date: Sat, 28 Nov 2026 04:54
74 lines
4447 bytes
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=301211

            Bug ID: 301211
           Summary: SCTP peer restart leaves ecn_echo_cnt_onq inconsistent
                    with the control queue
           Product: Base System
           Version: 16.0-CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: kern
          Assignee: bugs@FreeBSD.org
          Reporter: lee@jaeyeong.cc

During SCTP peer restart handling, sctp_process_cookie_existing() removes
all chunks from asoc->control_send_queue and resets ctrl_queue_cnt to zero,
but does not reset ecn_echo_cnt_onq.

The relevant code is in sys/netinet/sctp_input.c:

        TAILQ_FOREACH_SAFE(chk, &asoc->control_send_queue,
            sctp_next, nchk) {
                TAILQ_REMOVE(&asoc->control_send_queue, chk,
                    sctp_next);
                ...
                SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_chunk), chk);
                SCTP_DECR_CHK_COUNT();
        }
        asoc->ctrl_queue_cnt = 0;

ecn_echo_cnt_onq counts the ECN-Echo chunks in the same control queue.
After the queue is emptied, it may therefore remain non-zero even though
there are no ECN-Echo chunks left.

The SCTP output path compares ctrl_queue_cnt with ecn_echo_cnt_onq to
determine whether the queue contains only ECN-Echo chunks.  A stale
ecn_echo_cnt_onq can consequently prevent unrelated control chunks such
as COOKIE-ACK, SACK, or SHUTDOWN from being transmitted.

I reproduced this on FreeBSD CURRENT with an ECN-enabled SCTP association.
A CE-marked packet caused an ECN-Echo chunk to be queued.  The peer was
then restarted while that chunk remained queued.

Before restart:

        control queue head: ECN-Echo
        ctrl_queue_cnt: 1
        ecn_echo_cnt_onq: 1

After restart, the control queue contained one COOKIE-ACK, but the
counters were:

        ctrl_queue_cnt: 1
        ecn_echo_cnt_onq: 1

The output path treated the COOKIE-ACK as if it were an ECN-Echo-only
queue and did not transmit it.  The peer repeatedly retransmitted
COOKIE-ECHO.  A subsequently queued SHUTDOWN chunk was also not
transmitted.

Since the restart path removes every element from control_send_queue,
ecn_echo_cnt_onq should also be reset to zero together with
ctrl_queue_cnt.

-- 
You are receiving this mail because:
You are the assignee for the bug.

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-admin@muc.de
Technical Details
Message-ID: <bug-301211-227@https.bugs.freebsd.org/bugzilla/>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!usenet.goja.nl.eu.org!3.eu.feeder.erje.net!feeder.erje.net!news2.arglkargh.de!news.karotte.org!news.muc.de!.POSTED.news.muc.de!not-for-mail

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!usenet.goja.nl.eu.org!3.eu.feeder.erje.net!feeder.erje.net!news2.arglkargh.de!news.karotte.org!news.muc.de!.POSTED.news.muc.de!not-for-mail
From: bugzilla-noreply@freebsd.org
Newsgroups: muc.lists.freebsd.bugs
Subject: [Bug 301211] SCTP peer restart leaves ecn_echo_cnt_onq inconsistent
 with the control queue
Date: Sat, 28 Nov 2026 04:54:19 +0000
Organization: Newsgate at muc.de e.V.
Approved: news-admin@muc.de
Distribution: world
Message-ID: <bug-301211-227@https.bugs.freebsd.org/bugzilla/>
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Injection-Info: news.muc.de; posting-host="news.muc.de:193.149.48.2";
	logging-data="74147"; mail-complaints-to="news-admin@muc.de"
X-Original-To: bugs@mlmmj.nyi.freebsd.org
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim;
	t=1795841659;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding;
	bh=zq9J4zyaqaiI2b3SAUGqB4GtZrtHjW8Ps7c8G3HoLdc=;
	b=N+w8FKfrMVyLU/8W1JwD8pkV4IkNA4Axv0w/NgMUI8d6pMc43lJheGoCshBBTylaFXLp0i
	PA67+rv7KmHv4R1izwsx7kIz2puI0jeaK/vHFnWX6I+j/yXvhbzJxO/9MjTi09eguZQO+L
	LO9T6cFyQIux5mw9ItCn2XyuXFPJtZdy7EfBWrZpdEXkPVRD98PXuSTW8MJ15jUAFQTfFN
	meIKKco7uuHfGM3HquJe4oe5gcpNN3bcZkKuNaPKUAQ+3mKmdhcA0PH0UNPhZ8JV8Ww4i4
	Syn/+Zoi0pJamt1ECv6LUbvUR80YRr08n/nU5FEEdhqQoJGIzISdtkL+bda3Cw==
X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f
Auto-Submitted: auto-generated
Precedence: list
X-Newsgate-Id: f02c70b8849f+
X-No-Archive: Yes