From nobody Tue Oct 08 10:14:36 2024 X-Original-To: bugs@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 4XNBhY1V7Zz5ZFlc for ; Tue, 08 Oct 2024 10:14:37 +0000 (UTC) (envelope-from bugzilla-noreply@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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XNBhX5xWJz4PDB for ; Tue, 8 Oct 2024 10:14:36 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728382476; 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=KYBYeGSySvKtrxpL0rp1H039BRVqp5JVskfXL+bymsg=; b=BSYdmZNblrK4msO+ANbm2h8NncOFyEmvwY2ihRu3Jp1Q/LQXNM/YG0asXro0W3HrNapErR 29Ba4H+YydGsSBOl5OzrBMbqADy+UK6yVOH0R+YOLYfWYsIkIX+B1IsPSBgOj5bE3uMFbW jx39qFdiU5HNemIcqNW4/V2s11FnVXaiDLRmwNPKLkEiTNnmTn0gXupyOknahXEmMP8tWn OkvMYJtc/FuMS1UbdHHWfW6FMeyycbeRsCOPl/rCYqtOeQoPiFJZzcpjN9dErQX2LtxFan /imrf98YHK85NSRiZoTr4PetzQvrMcy6xUmLwMFztODSef7D2L5eCzqGYkDQEg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728382476; a=rsa-sha256; cv=none; b=S7qsKg+BQC1phPat090zQe8qmxnfH962/MORryJvK6PT+6mSJMo4FF/Ecx1Al9XyN7l3K2 ZS2ukgaanLs39eJ/OX+r2BRMSxNb7sw/UvEE6+f8nJ3zLyduseUUc/lvWmoyoYKCrOND3D 9eVZ7jJ6eTJjVaDpol2AhiVHc63x0TfDFhZfllN7NG3ySxAlK3jM45BmBNgCY5hT0NtSz1 WlLdq1StMomKYf7nrksE9NqMxUXeXKbVocR6jaeBivZwcvT6GTajy+JP86k40WyNBzvGv5 nL4WIaDN6iZ+asnhpz+XMdqWyQVVEdSID8qX5RWgI6an3/VFu8cr/VeXhLSUAQ== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (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 4XNBhX5YLwzR8w for ; Tue, 8 Oct 2024 10:14:36 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 498AEaC1030557 for ; Tue, 8 Oct 2024 10:14:36 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 498AEaj5030556 for bugs@FreeBSD.org; Tue, 8 Oct 2024 10:14:36 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 281938] [PATCH] Make sure max_len is not 0 before using it as modulo Date: Tue, 08 Oct 2024 10:14:36 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: nakayamakenjiro@gmail.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@FreeBSD.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D281938 Bug ID: 281938 Summary: [PATCH] Make sure max_len is not 0 before using it as modulo Product: Base System Version: CURRENT Hardware: Any OS: Any Status: New Severity: Affects Some People Priority: --- Component: kern Assignee: bugs@FreeBSD.org Reporter: nakayamakenjiro@gmail.com Created attachment 254089 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D254089&action= =3Dedit proposal patch In tcp_default_output(), max_len is calculated and used as modulo: ``` max_len =3D tp->t_maxseg - optlen - ipsec_optlen; ... moff =3D len % max_len; ``` optlen and ipsec_optlen are variables and depend on the options, so it should be checked if max_len is not zero. --=20 You are receiving this mail because: You are the assignee for the bug.=