Date: Sat, 08 Aug 2026 00:44:09 +0000 From: Kevin Bowling <kbowling@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: 49fc8bbbffae - stable/14 - ixgbe: avoid signed overflow in pause time calculation Message-ID: <6a767bd9.3ecbe.48d029bc@gitrepo.freebsd.org>
index | next in thread | raw e-mail
The branch stable/14 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=49fc8bbbffae366e3063647b62e4f548226ddd94 commit 49fc8bbbffae366e3063647b62e4f548226ddd94 Author: Kevin Bowling <kbowling@FreeBSD.org> AuthorDate: 2026-07-28 11:10:09 +0000 Commit: Kevin Bowling <kbowling@FreeBSD.org> CommitDate: 2026-08-08 00:42:06 +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. (cherry picked from commit 35374c3ec69aa87561431e6236706c485bdeeacc) --- 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 c836ccebff0c..6495bfdecc60 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);home | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6a767bd9.3ecbe.48d029bc>
