From nobody Tue Feb 27 11:02:45 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 4TkZMV16Kfz5CxZq; Tue, 27 Feb 2024 11:02: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 4TkZMV0ZjKz41P3; Tue, 27 Feb 2024 11:02:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1709031766; 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=hcLkQA2eVo3Fhv1oj3MGXew4Lc58tiugZxn7oFGf9LU=; b=j/ieNiL3ShuymPsIi/tHiIKs3mhCkhBio54IWpJwGe6FQ2rvyHD/y98YiSsRjUQkJgq9LN iyqbFqyNfrZS0BtGPVqKrvTDItGvN7rYpE18zaNHzKt8oy/gu0kPcLG5a22zeZqR+oLQFk LXEatWgTt6BJAfhCPsG1AyHCvHhKMvyFOgws+lyXnXFlNERWZncNf+x6+5/j5PN8+64hVs wq2QTiVgONNQju7GTWG5Oa8k09tZvsotMvNL1NEGzFetK0or5uf3WxQVnpxPXKIUrWoHiU mim2TxsUl1GjH7cLUsL+xlyLepuMOiPhSPQrICLAfZ6QeKuuIlL+jcv+n+jqCg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1709031766; a=rsa-sha256; cv=none; b=WtaWcvXHJvdZXDS6wmD5XaKbmfWjCbo7tDgzNJw18mu4eDtEEUVlhXk1HtLx4FARvY9LN7 tUPb+mYMZJ8hMaUVM9/fNMS2QXlpZTQAvj8MmAWRKyhcf8XmhXkNkg8fAEXLDH7Xu+ShZl SsEORuwv2Dyf0DgvzIseJSJvYKo2v4OErzvyaUw+0AzqtF9IXoPZU62amwNsvk+XTfpBuD mTkFx7ktvRb59dz/fADIE5Jy89dQ0NDgzgGxuiFYfaGsxjLlcaxxocwfWflwYuskZwwkv5 LpXgDFplykFtPZjZRB568J+NWxQjOB1C9P58bqR2jUtQLoNIuWXJ7ggGTAjn6g== 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=1709031766; 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=hcLkQA2eVo3Fhv1oj3MGXew4Lc58tiugZxn7oFGf9LU=; b=imPZ7FVUBoHB6SqTgJwZS8hAaro7fdzZlH/8kO/CjNiU3GFHl6LNqlTDruGEzAHS6f9le4 dkEC9THqg118ZJPlHWX2RO9d8Nln2VrLjjAi6Yqg31JdStRRm+SIFksn24CRyfGU+19as1 X1K8CWDaOcF1b+xHDy+Su2B1VL8SxwVrtM2jS5XErhNtCH/9S9bqGtkUPON1EMgMSMQCBT LHQPKZUhuaXQlhtP27kS6M8/GmFCWc+A2e5X1CdR5NOXwf5aKtt2Er33bdzSch4aRlMoB6 bBPxSqEO+IOc3eNi+rrllY3fHYi7bS9GKDuAk7TxBUPwx14zcf6/EutnEGPCkQ== 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 4TkZMT6kbYz18gw; Tue, 27 Feb 2024 11:02:45 +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 41RB2joZ014244; Tue, 27 Feb 2024 11:02:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41RB2jRZ014241; Tue, 27 Feb 2024 11:02:45 GMT (envelope-from git) Date: Tue, 27 Feb 2024 11:02:45 GMT Message-Id: <202402271102.41RB2jRZ014241@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: 419848219b40 - stable/14 - 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/14 X-Git-Reftype: branch X-Git-Commit: 419848219b408cc52befcaa7849a2905f3812a83 Auto-Submitted: auto-generated The branch stable/14 has been updated by rscheff: URL: https://cgit.FreeBSD.org/src/commit/?id=419848219b408cc52befcaa7849a2905f3812a83 commit 419848219b408cc52befcaa7849a2905f3812a83 Author: Richard Scheffenegger AuthorDate: 2024-02-24 15:35:23 +0000 Commit: Richard Scheffenegger CommitDate: 2024-02-27 11:00:55 +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 93720c407d5d..4581b05280e0 100644 --- a/sys/netinet/cc/cc_htcp.c +++ b/sys/netinet/cc/cc_htcp.c @@ -230,9 +230,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; } } }