From nobody Fri Jul 31 11:30:16 2026 X-Original-To: dev-commits-src-main@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 4hBP4m3wLQz6mZCx for ; Fri, 31 Jul 2026 11:30:16 +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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4hBP4m38ylz4968 for ; Fri, 31 Jul 2026 11:30:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1785497416; 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=EDHADqrOUM+gZ23heR0E1U7DSq7WdqDFXia9jKUXo6M=; b=KL/K2XcvuLE9/rzxXJrcfwIgizFfh2QkAnATSYymXyk7bMV/vc81FpEApkg6/66pSEZ2aj BldbX/GqYS72xQpmhVm6aFMstwAxdwOtl8udUBkxqa6MDM7MefvkATKOjO3mko8U1TTcXD nl9BOVqWO35f5u0bMaEdTGyL+q5r/zl6vJEJ5nsovM02FXz+0NUFPIFxT7uIJ5oWIRu9Pb HsYG4N3RCFIQn+2nfZnDgB7J2M7lkEDOUV+ciXaDcw3viPMuambnaQpab0Ck76v8r23d2S qPt99w7vN5kym79Oyo4Sa5uciZOp8k6AZmt5GtJKzfpT7uhBOfNePAeJadwKkA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1785497416; a=rsa-sha256; cv=none; b=m/6GjqD9bKFLvarYR0WWnpNMoCxuswA2A18uQJrPu9tHKxThas1wsCien9pO497NU75Rul dIxEiBpp21QdBNOLLap1kG99YrpCkCDxNxqlpM4ppCuklmzvIueQzDoUQQhQFlrQi1RDy+ l9oJ2dZVLOEJOprQLl2YAwrHtaIO/3Yyk8bVZ1o340mnFVksJ9FfVWlCfzJoJRXoXLtHOx /b+nHTNDnDvwtf81kU5bQBFSUj663QyFqHNYyQ4Bt6Zc+VeZcw5zUAMNS4FJ9i2jtmlXh9 kCGSSJ98hU+wm+PZ3zxOCaKs7mm+cE3tsWAK2iNWonHEqUQs1bm3673GEi+hPw== 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=1785497416; 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=EDHADqrOUM+gZ23heR0E1U7DSq7WdqDFXia9jKUXo6M=; b=XGO7SZeP2fwB7UyYBpcm0yJrVkO8+Zwc+RmdkkvqQmfeU9YZk4xfCZGFs3loSZQVY1GaOQ cLzxGXqcfxsMApd+6oSH+7kfHLcrto0+SCJrBpBulC8htapoiiMJQ8LZjohXI7I+aI/fg/ i2MpIfAMtmnYrs/QYZ6D9sfpQI4GUxSFAzAvQ5VkzngJI3YxNxIAI+ap61zNrBBQnSuI6m C1y3PbJHsjKsENo7cOdwFnco3K0SybsQKChCL0lIvVo/04xlz637Kxz09wkqK2L7j+B4KU 1g8uNgeeokGZ9jKMBHI/dAKz+qzsqz2AnrSola0gUBR7oh0xmpqzjrWfuht2ag== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hBP4m1ym1zxqR for ; Fri, 31 Jul 2026 11:30:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3d8ff by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 31 Jul 2026 11:30:16 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 35374c3ec69a - main - ixgbe: avoid signed overflow in pause time calculation List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 35374c3ec69aa87561431e6236706c485bdeeacc Auto-Submitted: auto-generated Date: Fri, 31 Jul 2026 11:30:16 +0000 Message-Id: <6a6c8748.3d8ff.7ba7364f@gitrepo.freebsd.org> The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=35374c3ec69aa87561431e6236706c485bdeeacc commit 35374c3ec69aa87561431e6236706c485bdeeacc Author: Kevin Bowling AuthorDate: 2026-07-28 11:10:09 +0000 Commit: Kevin Bowling CommitDate: 2026-07-31 11:29:53 +0000 ixgbe: avoid signed overflow in pause time calculation pause_time is promoted to signed int before multiplication. Its default value of 65535 multiplied by 65537 exceeds INT_MAX and triggers UBSAN, even though the result is assigned to a u32. Make the multiplier unsigned so the calculation has the intended u32 semantics. Linux commit 3b70683fc4d6 reported the failure in the generic path and used the same mechanical correction. The 82598-specific flow control operation contains the identical expression, so correct it as well. MFC after: 1 week --- sys/dev/ixgbe/ixgbe_82598.c | 2 +- sys/dev/ixgbe/ixgbe_common.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/ixgbe/ixgbe_82598.c b/sys/dev/ixgbe/ixgbe_82598.c index e32fdb8f039c..f27f263dd07f 100644 --- a/sys/dev/ixgbe/ixgbe_82598.c +++ b/sys/dev/ixgbe/ixgbe_82598.c @@ -535,7 +535,7 @@ s32 ixgbe_fc_enable_82598(struct ixgbe_hw *hw) } /* Configure pause time (2 TCs per register) */ - reg = hw->fc.pause_time * 0x00010001; + reg = hw->fc.pause_time * 0x00010001U; for (i = 0; i < (IXGBE_DCB_MAX_TRAFFIC_CLASS / 2); i++) IXGBE_WRITE_REG(hw, IXGBE_FCTTV(i), reg); diff --git a/sys/dev/ixgbe/ixgbe_common.c b/sys/dev/ixgbe/ixgbe_common.c index a8676c731711..0b6bf728f25e 100644 --- a/sys/dev/ixgbe/ixgbe_common.c +++ b/sys/dev/ixgbe/ixgbe_common.c @@ -2932,7 +2932,7 @@ s32 ixgbe_fc_enable_generic(struct ixgbe_hw *hw) } /* Configure pause time (2 TCs per register) */ - reg = hw->fc.pause_time * 0x00010001; + reg = hw->fc.pause_time * 0x00010001U; for (i = 0; i < (IXGBE_DCB_MAX_TRAFFIC_CLASS / 2); i++) IXGBE_WRITE_REG(hw, IXGBE_FCTTV(i), reg);