From nobody Tue Feb 22 22:56:54 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 0488119E9780; Tue, 22 Feb 2022 22:56:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4K3F0k6Ysrz3lXV; Tue, 22 Feb 2022 22:56:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1645570614; 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=8eOmRdGo3O72jdll2I+2pGeQP8jImXToc1Vcl2KgiKo=; b=ydcQ/Om2+LameTuYItNEyOIgP/35nYKYvD32Or0ZpnuV1sJXijHBKS4uSLVnCf2nzeU2EE +1H+mAY0XCaZmbD4tCUcV9HEhfW/Fc86N6CriwhJkon9HdpHVfjEi0ETq63fJhUImDd8Lf mafyUpYILygZ8Hb4PYgpxvVRt6i8IkEU6YjSoYt9qijyygzpaO3Dt7mOpYTcJo4PdbE0Kg wE3Pw7S3R58QZQ+6Jz+QdAuQoARW7RXIyYA+O93NoMx6O0k1i0XmCxrktXxfKcFiS3BBUH hgIrbjPgQemgHD0OmuhD9uVF2yEB0jJB+oyj+2aIOiTYZCS2tj8ResdeIQ7cYg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C134B5138; Tue, 22 Feb 2022 22:56:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 21MMuscw070053; Tue, 22 Feb 2022 22:56:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 21MMusG6070052; Tue, 22 Feb 2022 22:56:54 GMT (envelope-from git) Date: Tue, 22 Feb 2022 22:56:54 GMT Message-Id: <202202222256.21MMusG6070052@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: d67ef7473591 - stable/13 - sctp: fix usage of stream scheduler functions List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d67ef7473591476ebb44fb37da2ec6f104035be6 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1645570614; 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=8eOmRdGo3O72jdll2I+2pGeQP8jImXToc1Vcl2KgiKo=; b=GF1zYgSoV1hVOvhqLXtukg+cP4GZtfeECaZbURXcvhmSRpJfLH/ZNKejbNafvWn1KDSL8v uYwk54VTQlgECk6gz31B5WwLdZrBQgvOEDLt2KXV9PNS4Lss4mCheFKIWBwKccLkAZy37q 2tTnrrikEt7fA2GGOMNTZTbaHVrdC8cjLiKA+fg9YhBG13jW7nL3EMiwvCvyTLYKDOM1e4 CCdlpHHUPk9A7CKo4pUUjeDVmX0jw+vQcTACkUyDKMx1QtuC7kfxrBalOVQUBVlTo6oMVK lGgut21ETpfuCzoK//aL0c0ZP4PaIC0DbV0VKQ4DsEztTDFx45HF+JhNJESGVA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1645570614; a=rsa-sha256; cv=none; b=POFqWWB6V9st31gLU70LJ1iiWH+5rJwZ2eTwapJfgbu/BD6kAyULqqZVAwdr4CombqX5+r sKXupGWmMy/jaHPfeNH3MUo9Ax25cAq0BLmADdyAtZvD/UisbOEFyAmY8TATa2boEef53i 3heXwXHuQg/oEOPyoyLt1d5a7Zyu5yf7e7yMRfpnccjv4jpRQt+RwdJveGInmTklhipCg7 F1xHBbhJ1MNq55oodrlMHf/QoZC8CzisVOqJUrP29lf4GN/J1S9gvOrQJC3GA7Fke5Go8v at9oax6lOoyXY6QpY6aJtKl/VHuaQHiTvI2x/jVNJJ20a7ykdopYyFR7pTk8wg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=d67ef7473591476ebb44fb37da2ec6f104035be6 commit d67ef7473591476ebb44fb37da2ec6f104035be6 Author: Michael Tuexen AuthorDate: 2021-09-28 03:25:58 +0000 Commit: Michael Tuexen CommitDate: 2022-02-22 22:56:26 +0000 sctp: fix usage of stream scheduler functions sctp_ss_scheduled() should only be called for streams that are scheduled. So call sctp_ss_remove_from_stream() before it. This bug was uncovered by the earlier cleanup. Reported by: syzbot+bbf739922346659df4b2@syzkaller.appspotmail.com Reported by: syzbot+0a0857458f4a7b0507c8@syzkaller.appspotmail.com Reported by: syzbot+a0b62c6107b34a04e54d@syzkaller.appspotmail.com Reported by: syzbot+0aa0d676429ebcd53299@syzkaller.appspotmail.com Reported by: syzbot+104cc0c1d3ccf2921c1d@syzkaller.appspotmail.com (cherry picked from commit 5b53e749a95e7f18475df9f9ce7984a31880a7ee) --- sys/netinet/sctp_output.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/sys/netinet/sctp_output.c b/sys/netinet/sctp_output.c index de5241555fd8..2f5183bacc9a 100644 --- a/sys/netinet/sctp_output.c +++ b/sys/netinet/sctp_output.c @@ -7142,6 +7142,7 @@ sctp_can_we_split_this(struct sctp_tcb *stcb, uint32_t length, static uint32_t sctp_move_to_outqueue(struct sctp_tcb *stcb, + struct sctp_nets *net, struct sctp_stream_out *strq, uint32_t space_left, uint32_t frag_point, @@ -7555,6 +7556,7 @@ dont_do_it: sctp_auth_key_acquire(stcb, chk->auth_keyid); chk->holds_key_ref = 1; } + stcb->asoc.ss_functions.sctp_ss_scheduled(stcb, net, asoc, strq, to_move); chk->rec.data.tsn = atomic_fetchadd_int(&asoc->sending_seq, 1); if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LOG_AT_SEND_2_OUTQ) { sctp_misc_ints(SCTP_STRMOUT_LOG_SEND, @@ -7672,8 +7674,8 @@ out_of: } static void -sctp_fill_outqueue(struct sctp_tcb *stcb, - struct sctp_nets *net, int frag_point, int eeor_mode, int *quit_now, int so_locked) +sctp_fill_outqueue(struct sctp_tcb *stcb, struct sctp_nets *net, int frag_point, + int eeor_mode, int *quit_now, int so_locked) { struct sctp_association *asoc; struct sctp_stream_out *strq; @@ -7708,9 +7710,9 @@ sctp_fill_outqueue(struct sctp_tcb *stcb, giveup = 0; bail = 0; while ((space_left > 0) && (strq != NULL)) { - moved = sctp_move_to_outqueue(stcb, strq, space_left, frag_point, - &giveup, eeor_mode, &bail, so_locked); - stcb->asoc.ss_functions.sctp_ss_scheduled(stcb, net, asoc, strq, moved); + moved = sctp_move_to_outqueue(stcb, net, strq, space_left, + frag_point, &giveup, eeor_mode, + &bail, so_locked); if ((giveup != 0) || (bail != 0)) { break; }