From nobody Mon Aug 24 00:53:46 2026 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 4hSsqH1Yr3z6q2VC for ; Mon, 24 Aug 2026 00:53: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 "YR2" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4hSsqG6bBrz3vyp for ; Mon, 24 Aug 2026 00:53:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1787532826; 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=VH59CFIQY+zffwOlylmH+XtZPggIq6RYFU1hKitscqI=; b=UWX22RhLwtwgIGUa1ZT7++N7niuQ+ALQ1q5RcLEJIMxvbd6+Z0MpqVbzYdUMdRMYSVQ73e ViPrc/ihwnHNlbg4XNxDXDMhhK/uy9trIzLZ+lrzgdfux0LJ2iRehtC89JE/AYQK1MNl4x mk6Po7hJH51cBYnp4nty6RS3YFC3I7BUhMr1b58UXVYC2yc6wntuWJM4p2Nrr2G3gYhdd1 fUX7BHX3tEncT8bhVq4Z6AlgU9ejvDkuGmfM0rSUxd8+/f3FVvsNkRmUGQ6EyitFnYuEim ccLw0ZECAeVEGdACPBm2aabxbonQzVH7EypeAipPhLJpqlaCxdjxKZbplamlQA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1787532826; a=rsa-sha256; cv=none; b=Ic0Rm9Oxi5jfpW9dpv808j+iKL479OX21RJLmz6aXwH6itNSmoLhwfVKzJ5pO1DzZKNG9r yn3Vmb1CMf8YjY573cwZ4wDzNiKhnG0wMNrAhkuLsfxlhZNw76ASDIz7gex7rCllc1loj/ nC6aUCVs2DHIO1dCb8l0pp4g+ZUQMQGQC9hWAiBAlWuURnHKneSFgOaW9jfS1lZCjBMvEJ 53otmXClaj1B7kQle02WAzad6PpjQihYB1ziJSYyCxs7eAqkwVHHU7VQhwvXqUcTS7TokQ jxPbyxLeQOl+IgzstO/Mfz+l2zIaQuYC1vGLnUo+34d59fSBnZ3O95ii9bD6Sg== 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=1787532826; 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=VH59CFIQY+zffwOlylmH+XtZPggIq6RYFU1hKitscqI=; b=Hs4RTuQFH4zHaR4Vxp5uA1x56kJCp+pJctEE0Uzm/Dy21tcaBOz/pSd4SGMURX6p5+JNTW 7Re/Xc9MnZ3hkOwKQN+k5hHxbBDT9eY0LgSiFxFbE3fnstb51w/yQ3v6HInJfNLS89F3OX eZ4fpvDCLfRdxTjU9Z26IdNZu/liMjCUDCzt3MLbH+RkEJ3sozHmroginkxPZv+lx5RUTt HGBLO9d2umN/FaNKh+OhUVbdSYGeDaiUF/8ae5IvGvSSLdZmWaumGzjtTZsHXTNmSXyILl Z8S5fJJcE8zQfPL+2xnDJpMrVfxTIHoHp1SATjcJAYbWTV05xAt0CYa0ioYxQw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hSsqG5R4tzhxn for ; Mon, 24 Aug 2026 00:53:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3224a by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 24 Aug 2026 00:53:46 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: c7f0473df2ed - stable/15 - ixgbe: Validate EEPROM checksum section bounds 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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/stable/15 X-Git-Reftype: branch X-Git-Commit: c7f0473df2ed901f9c6559fb152c457dc4296c13 Auto-Submitted: auto-generated Date: Mon, 24 Aug 2026 00:53:46 +0000 Message-Id: <6a8b961a.3224a.3d809a7e@gitrepo.freebsd.org> The branch stable/15 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=c7f0473df2ed901f9c6559fb152c457dc4296c13 commit c7f0473df2ed901f9c6559fb152c457dc4296c13 Author: Kevin Bowling AuthorDate: 2026-08-10 15:09:41 +0000 Commit: Kevin Bowling CommitDate: 2026-08-24 00:51:04 +0000 ixgbe: Validate EEPROM checksum section bounds The generic checksum walker trusts NVM section pointers and lengths and iterates with a 16-bit index. A corrupt section that crosses the end of the EEPROM can wrap the index and leave the driver in an effectively unbounded read loop during attach. Validate each non-empty section against the discovered EEPROM word size before reading it, and use widened arithmetic for the inclusive end and iterator. (cherry picked from commit be3e1068ea8699fb719691453899ca20a601fe1d) --- sys/dev/ixgbe/ixgbe_common.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/sys/dev/ixgbe/ixgbe_common.c b/sys/dev/ixgbe/ixgbe_common.c index c4e78a048b49..38951c09fb27 100644 --- a/sys/dev/ixgbe/ixgbe_common.c +++ b/sys/dev/ixgbe/ixgbe_common.c @@ -2221,7 +2221,8 @@ static void ixgbe_release_eeprom(struct ixgbe_hw *hw) s32 ixgbe_calc_eeprom_checksum_generic(struct ixgbe_hw *hw) { u16 i; - u16 j; + u32 j; + u32 word_end; u16 checksum = 0; u16 length = 0; u16 pointer = 0; @@ -2248,6 +2249,10 @@ s32 ixgbe_calc_eeprom_checksum_generic(struct ixgbe_hw *hw) /* If the pointer seems invalid */ if (pointer == 0xFFFF || pointer == 0) continue; + if (pointer >= hw->eeprom.word_size) { + DEBUGOUT("EEPROM pointer outside word range\n"); + return IXGBE_ERR_EEPROM; + } if (hw->eeprom.ops.read(hw, pointer, &length)) { DEBUGOUT("EEPROM read failed\n"); @@ -2256,9 +2261,14 @@ s32 ixgbe_calc_eeprom_checksum_generic(struct ixgbe_hw *hw) if (length == 0xFFFF || length == 0) continue; + if (length >= hw->eeprom.word_size - pointer) { + DEBUGOUT("EEPROM section outside word range\n"); + return IXGBE_ERR_EEPROM; + } - for (j = pointer + 1; j <= pointer + length; j++) { - if (hw->eeprom.ops.read(hw, j, &word)) { + word_end = (u32)pointer + length; + for (j = (u32)pointer + 1; j <= word_end; j++) { + if (hw->eeprom.ops.read(hw, (u16)j, &word)) { DEBUGOUT("EEPROM read failed\n"); return IXGBE_ERR_EEPROM; }