From nobody Tue Feb 22 23:57:47 2022 X-Original-To: dev-commits-src-branches@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 E7F5419CF60B; Tue, 22 Feb 2022 23:57:47 +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 4K3GLz6C7vz4Sx7; Tue, 22 Feb 2022 23:57:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1645574267; 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=t/GVthCCAqjjNCYnNw+IWiri4c4V9BK5Mfehuf5bLAI=; b=ta2Cq4N6ZKkmSXPzWNCgUXiXRrItzmsaELsWUYv+qZgV0Vyll0zQJgdv+e1x1I3eWnIwDo pLhI3MeB00oUWk3FzZNA4EPV3aXTG0tEXPtOL6NDFGc5AO6SqE/NWzTXO0Q9FyLaZ4Nu+E JlkBdmhLkNGWdxdfCB7qFWRQ0mMJFDrGoyKJMdpFssqFfaZB2CyI6OJQbja60Nws4J/tvZ MwYIp91nlh+Yrv+2Al3n4untQZ7/gxBT5H/PQh+VSvHHGtlHBurK4sF6sWdwtWOtwc870T ePCvXW2T/CMvHapa/qafce8qzdCl644VV56ySTwBgN7LIMcY7lzNmmZG+LmmHw== 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 B63935B6D; Tue, 22 Feb 2022 23:57:47 +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 21MNvlKa051803; Tue, 22 Feb 2022 23:57:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 21MNvlCn051802; Tue, 22 Feb 2022 23:57:47 GMT (envelope-from git) Date: Tue, 22 Feb 2022 23:57:47 GMT Message-Id: <202202222357.21MNvlCn051802@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: 0f63c2d187c4 - stable/13 - sctp: check that the computed frag point is a multiple of 4 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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: 0f63c2d187c4b67cdeaa0d4cfdae88db48106bcb Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1645574267; 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=t/GVthCCAqjjNCYnNw+IWiri4c4V9BK5Mfehuf5bLAI=; b=O3BmdFvbQDXaaXy2JqfC2xRZxaF4eX5IFkAbGdrpLf608gV2Of6gL5aWhegxBwnIjqsoUJ wjdj3sRUUhPpnvyHr874DK91Rq/LktC7VXd/gA9C5aRfvHYhUNeoNs07qLozrpvqKKgvef UCDwm1kEWX2FllpOI5eiBgjRqYDWu4OGj0a4WNZ3EJ+8p2x48clB+3/QAv5UvR2//1/4zD VeU+zvDDRdQccplqyladbgRI24zIf+3ErueyBrEiuNLPZWAnG1SQ3/xwTKbWCmadTEtWkj r6Y9zDgKq52IWgxSimmZnvV7IJpYB+dep5W8lUvwJCWKvZ2PXAlvYCvUQm8l4A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1645574267; a=rsa-sha256; cv=none; b=JLpL3pxvYZbicRjBPlsyoJgQSbYBm3V/rnIo0iKPTFh6BtWaCceLMavCgEKs33wZ8nAQTU RyLdN/4K2bXfEz+Z8ziYffH1RpMOk6fw/OoH3KOfIAxIAO1ON7YTJFGXHwOyoL+l+UTswr 0qp0tcssRl+626TCTWUbY3pJk7KSqaVOFAMfAfQyae1ODf1MQhOiCcRmzU7nQzaAUwSgef W8SFNoaVi0oihaB5QDbiBHJrkOwCIWkjmlySH6B6c0i7z3r2ZRJvLN0fyydkHjKLbg4cK8 5Rc2HTdp2FJP7fZBxe719xuGVOurDMvwNWDVaHO2McQQ9fx5sBGWfD8Es7+GGA== 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=0f63c2d187c4b67cdeaa0d4cfdae88db48106bcb commit 0f63c2d187c4b67cdeaa0d4cfdae88db48106bcb Author: Michael Tuexen AuthorDate: 2021-12-28 08:40:52 +0000 Commit: Michael Tuexen CommitDate: 2022-02-22 23:56:17 +0000 sctp: check that the computed frag point is a multiple of 4 Reported by: syzbot+5da189fc1fe80b31f5bd@syzkaller.appspotmail.com (cherry picked from commit ca0dd19f09335496390829851862c894f89a87f9) --- sys/netinet/sctp_output.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sys/netinet/sctp_output.c b/sys/netinet/sctp_output.c index 598831220033..8b4a891c23aa 100644 --- a/sys/netinet/sctp_output.c +++ b/sys/netinet/sctp_output.c @@ -6246,13 +6246,12 @@ sctp_get_frag_point(struct sctp_tcb *stcb) if (asoc->smallest_mtu % 4) { overhead += (asoc->smallest_mtu % 4); } - KASSERT(overhead % 4 == 0, - ("overhead (%u) not a multiple of 4", overhead)); KASSERT(asoc->smallest_mtu > overhead, ("Association MTU (%u) too small for overhead (%u)", asoc->smallest_mtu, overhead)); - frag_point = asoc->smallest_mtu - overhead; + KASSERT(frag_point % 4 == 0, + ("frag_point (%u) not a multiple of 4", frag_point)); /* Honor MAXSEG socket option. */ if ((asoc->sctp_frag_point > 0) && (asoc->sctp_frag_point < frag_point)) {