From nobody Mon Aug 24 09:14:24 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 4hT4wx31sYz6p6Q0 for ; Mon, 24 Aug 2026 09:14:25 +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 4hT4wx0yj3z3vr2 for ; Mon, 24 Aug 2026 09:14:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1787562865; 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=ALmNQmILA6v3WwTXzLFVoDR96SVu235UQhFLHaBAbqo=; b=M4PTV/KOaQSvupASA5OGnqkxWmcsLmomVF4YgayoWTT2zmD3o1b3MuEGB7zr88IeFF7tbx 7rPqcsiIDalXSsrvGO/wkMWq2xHLlz1USZJ/u2gURAb9wfSoOsYmVOKjj1v2WaYzBDK2Ae GLXiby86I8TIAic3ii9xpwbHRjeKkmJBFAMJDFiXUfFd+NOOGQD3EA7Om9rCmLZTxUxTQX I7Mwg+zXrke1jZA0RmOIuPc/tws1AnpKNi+9QkqzDyuHVnfxpB8klwV9CniHdMDZ+tg5sN QMeMm3LuyTrC29YnWBDpXxSlyTotMH6xIb6eybGCGfvd2DH0jx42uDoUR6lC0A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1787562865; a=rsa-sha256; cv=none; b=MoUi4EKbS3unReXQbdun9T5i77Vn0kGgqvH2r6qAMQzT2eudCZsdj/iMptBqI7lNr779nx UQ6ETKRZXgZPuGixsrY80QRT1j/xEXBQ2oznLX9euo/ELbQKeBRhtg7urnJpEdz8QpIhk9 8db1bMVBdx4zuGFRQzxUDRsspUjJL8Iqi8pzT1dUD8Fe6j7F+O6zouSCXiS5ZsGoFNa6GW 2D/8aqOOjQAwCyOyYRTXCoc1lGr5fv2u6ovgVAn7yuOALujYln5lLjaaiFpXa0fp1Y7OA3 hZXDopaeYr3uG9gmUHjpVwTjN5XwnGoYLa0Ul0WcyUbIXvhDBXApd1J/nMSYfg== 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=1787562865; 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=ALmNQmILA6v3WwTXzLFVoDR96SVu235UQhFLHaBAbqo=; b=ZY60Z9DGrQEcQy2JKR2UzmuGX7mlPF4pWLhJQpEzJOeQPtEE7BpeCObveF2Nx9+xbuWsRU oqb7rdmx3KC6IZo7/IwwL0JlunDjKHiefM+lu5CeEN/GPG6lKKS1sH02nXTriwAf7Od+pC E/Q96E1kn12BambCll4mmrBu5achJDhw6ElzTpa70f2tLICwCznTXDF5uhvc54uOY7OQFQ XW/tiWpKZKqOiO/VWJ7BuPKb45M9kafzYMhe5K8jEWoFGfrOMq8XYmRwNuJU+k9NxYmtvN dP1azxaZ6egqh+cOKPgPRmHq16Fw0jaDmoilmDJwmo3IyfvuEZxKwRFKY4mwOQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hT4ww73vMzygC for ; Mon, 24 Aug 2026 09:14:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 46e7c by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 24 Aug 2026 09:14:24 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: c6c6d71def5f - stable/14 - 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/14 X-Git-Reftype: branch X-Git-Commit: c6c6d71def5f225742f092f18020460824a9d714 Auto-Submitted: auto-generated Date: Mon, 24 Aug 2026 09:14:24 +0000 Message-Id: <6a8c0b70.46e7c.2bd8134b@gitrepo.freebsd.org> The branch stable/14 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=c6c6d71def5f225742f092f18020460824a9d714 commit c6c6d71def5f225742f092f18020460824a9d714 Author: Kevin Bowling AuthorDate: 2026-08-10 15:09:41 +0000 Commit: Kevin Bowling CommitDate: 2026-08-24 09:12:22 +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; }