From nobody Wed Feb 28 00:26:46 2024 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 4TkwCB4DSrz5C1GB; Wed, 28 Feb 2024 00:26:46 +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 4TkwCB3hcnz4V1c; Wed, 28 Feb 2024 00:26:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1709080006; 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=54tkdpuYt32W0kFh5YZUuE4b2h2KRXQ+gPSvPT3uSiU=; b=QEpVvH2kt7io8zkI9ZWLezALoYtuz3gnCy0uTT87om7i/1oSIUtTRzv10Z3lgXwL3pic/d 5X6m+7zO4n1t/T5GMtzWUu9ctLXxaI4eZxEFumAbJYdeAIe57OhCeUSgmXGkKWaYieUs/k z5nyJ4pQ1ymiffxhKfa8y/YBVR6Jn8VxCEJWDx0OTD3ID5kEOCzOxLCy1jCxChnQ1X00Xp NgHEIodkyf7omUPaE+0wSyDzgvB6DRhn8Rqd3jcKUoe1yX4lTHSMtiJCp8YHbz7bFUN0Ic daC9xwTbFfBsOYqxe8Q8yq2ylg6OhpB1Skw+LnCDJ16416XPfhDXKnHRzLJzMg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1709080006; a=rsa-sha256; cv=none; b=Jh+QXmf8b9LTov01QCBY6WAtJGwRGe01Z83qHU5BZb6DoS9IOp1WQ8dfUq6KNw/DuNN8Xt YG0q0hOue/+zTmq+qaE+piPJMPk185Ka4e00tMQooscvYHpL/+MmLrWB/m7v4k8Zkx5P8H m00blc0m+p3AWvD+V8DEFa427eohBMH/QBzpVKF0idwnmKWGS1wbOqjteqP75t7FYK3LVH /BWzvqosQpdwHkbpLg1d5cShZERkbLema1UuDbMS5vzeYvBpw8jFMhUdE8SiFtSBGqIiVf ZxFdgBhCN/0X/yNR4OHW4+UhLIbHVFJ7ej57u5CfdMBmX3e6PvFvRa7Se9C0EA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1709080006; 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=54tkdpuYt32W0kFh5YZUuE4b2h2KRXQ+gPSvPT3uSiU=; b=QUIpbwEvfwlqsCn60I1qmYFPgk6CwWFkkeTiUHx1+s+jpSBdiOLCG+TGEfOnISe/UlKe4M yf5nICDek9JDqPwu6ppwjzKotpMDewUIcyE1NjpUzvGn0bfhGKJwuvrOqbSBUPzC6JTFQS TIQyCSS4sI5t2H857DbsuESIgjq9vj2AixkJMz1fsGL1u2bIoxFulg+HE3TLhfGz8e4Txc dj/9bovFxeQqbyYnu/z+CI4LDnF6ip554WRA2QNkTgWUGDUGZgreJRP94OY/dhXBTpbrDN Qr3BRshkunxHTgp5JLicwPE905vKj1PMYZ3yV62RD7mtmlYncjUW/x4rtaWFTw== 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 4TkwCB2l2JzbFQ; Wed, 28 Feb 2024 00:26:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41S0QkOg065267; Wed, 28 Feb 2024 00:26:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41S0QkF2065264; Wed, 28 Feb 2024 00:26:46 GMT (envelope-from git) Date: Wed, 28 Feb 2024 00:26:46 GMT Message-Id: <202402280026.41S0QkF2065264@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Richard Scheffenegger Subject: git: 6e298c3612da - stable/13 - tcp: prevent div by zero in cc_htcp 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: rscheff X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 6e298c3612da3d04a75d380cf457774cb1a25a47 Auto-Submitted: auto-generated The branch stable/13 has been updated by rscheff: URL: https://cgit.FreeBSD.org/src/commit/?id=6e298c3612da3d04a75d380cf457774cb1a25a47 commit 6e298c3612da3d04a75d380cf457774cb1a25a47 Author: Richard Scheffenegger AuthorDate: 2024-02-24 15:35:23 +0000 Commit: Richard Scheffenegger CommitDate: 2024-02-28 00:21:47 +0000 tcp: prevent div by zero in cc_htcp Make sure the divident is at least one. While cwnd should never be smaller than t_maxseg, this can happen during Path MTU Discovery, or when TCP options are considered in other parts of the stack. PR: 276674 MFC after: 3 days Reviewed By: tuexen, #transport Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D43797 (cherry picked from commit 38983d40c18ec5705dcba19ac320b86c5efe8e7e) --- sys/netinet/cc/cc_htcp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/netinet/cc/cc_htcp.c b/sys/netinet/cc/cc_htcp.c index 70ac0bebffe9..6568c5ae672e 100644 --- a/sys/netinet/cc/cc_htcp.c +++ b/sys/netinet/cc/cc_htcp.c @@ -226,9 +226,9 @@ htcp_ack_received(struct cc_var *ccv, uint16_t type) * per RTT. */ CCV(ccv, snd_cwnd) += (((htcp_data->alpha << - HTCP_SHIFT) / (CCV(ccv, snd_cwnd) / - CCV(ccv, t_maxseg))) * CCV(ccv, t_maxseg)) - >> HTCP_SHIFT; + HTCP_SHIFT) / (max(1, + CCV(ccv, snd_cwnd) / CCV(ccv, t_maxseg)))) * + CCV(ccv, t_maxseg)) >> HTCP_SHIFT; } } }