From nobody Fri Sep 20 03:34:53 2024 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 4X8ygd6ZbJz5Whpb; Fri, 20 Sep 2024 03:34:53 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X8ygd5sLnz4P6h; Fri, 20 Sep 2024 03:34:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726803293; 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=cSmpvv4ppG52qGNKx7DJtpaEkY/FN8i3ejiItKC5Vac=; b=sM/+kNpTypcSy5Anis+hwYg6m14mShbTt76cVoNv1B0UwVrzlq7K7zPOeVYbpcTxsk+lEd WxKtbfIJPOiPzXK2dTJI/0ZkjBykWO1XvzFtEMzWET1asLXNUynbYQl6EVAn7GqeaP/zSz /Wi8oo8uq8B+QviAXCSo0FjdW++xHhnM0z+9rFI3WcITLU5RxBXrVUrtgYFwBV2ZhfHAjb y3pYbQMfBD4r0KCm5q8D4zWpH/s/gRef0XbMRF7tYkP7OkBzinaN3ONc85mw2443HJPKrh SO96/GxLXcfjU7q/GJ7oOnSc362mw5n/xHhw23r9d57w9U7KAKlfzMDWIPGTiQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726803293; a=rsa-sha256; cv=none; b=gyG/nHiNhNQsk7ETcJ46c3usY4FSBhzcXWErN69N0IAE+0jOP4pQ7KyI6wR0PKlSeWFTd4 hjl/nwm0L7NPaEqwMJckx2BlN/qtFm8Ump47JpNVijyE9E47FKu9EoZNMIYBFGR8zPt/Vq hHYh/iv92JVIkHpaEq0PsK6q47NsnllpIhx0/xK/ImU+4O9NMq2C713oNatk+qzz+QZ0rP BJ9gBLt64IeDXiBlE3jkVKdCzAJ4DWi9O2u3WW87iQ0CISl3DQ2Y+xaf/SRTOg9Tie7p9h DPyXHHm5XGDnlcHqM136ER5fKe54zlUWoAUbCiZZ2Oqz2E6tQK/3IpqE+IAuUA== 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=1726803293; 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=cSmpvv4ppG52qGNKx7DJtpaEkY/FN8i3ejiItKC5Vac=; b=CLRr8ZBHaWvbiayhGBnA5BPx8WfsDmu9VqgdTBAGAe+odx2ZePT7++gaJof/o3S4lAryzh p2kbBi2VpqAkTuKgDLf1N+4ssN9DhelsGd7U7LX0ZSbwnVg2tUr7tDKSdFoNvxOrb05e49 gjxjjqB36GQpV6shY+XezOFxN7sln/3dj/P5vBye9vytA33pw7uug0wQnFOg33nZIzPXiW sET9IJeA4OON29nHlFK/GG35s0QKKjm2gdvzXzeuICLOIrzE8ui8NJlxRFIv4F9MMYkFPZ jSnzU/F+ITRCTw618/4Li4BzJPPxG6pHn0B3ScJ7ZTMgONKMxcCOc21HiyG0pg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 4X8ygd5SV3zYs1; Fri, 20 Sep 2024 03:34:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48K3YrAK085988; Fri, 20 Sep 2024 03:34:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48K3Yrqa085985; Fri, 20 Sep 2024 03:34:53 GMT (envelope-from git) Date: Fri, 20 Sep 2024 03:34:53 GMT Message-Id: <202409200334.48K3Yrqa085985@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 25771c8c1ae6 - main - ixgbe: prevent PBA read over eeprom word size 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 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: 25771c8c1ae606436823854de01fc2b23178e353 Auto-Submitted: auto-generated The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=25771c8c1ae606436823854de01fc2b23178e353 commit 25771c8c1ae606436823854de01fc2b23178e353 Author: Dawid Zielinski AuthorDate: 2024-09-20 03:33:37 +0000 Commit: Kevin Bowling CommitDate: 2024-09-20 03:33:37 +0000 ixgbe: prevent PBA read over eeprom word size DPDK commit message net/ixgbe/base: prevent untrusted loop bound Added length check against EEPROM size in words to prevent untrusted loop bound reported by static code analysis. Signed-off-by: Dawid Zielinski Obtained from: DPDK (6b58617) MFC after: 1 week --- sys/dev/ixgbe/ixgbe_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/ixgbe/ixgbe_common.c b/sys/dev/ixgbe/ixgbe_common.c index 7cf9b8d05127..7643d4028529 100644 --- a/sys/dev/ixgbe/ixgbe_common.c +++ b/sys/dev/ixgbe/ixgbe_common.c @@ -713,7 +713,7 @@ s32 ixgbe_read_pba_string_generic(struct ixgbe_hw *hw, u8 *pba_num, return ret_val; } - if (length == 0xFFFF || length == 0) { + if (length == 0xFFFF || length == 0 || length > hw->eeprom.word_size) { DEBUGOUT("NVM PBA number section invalid length\n"); return IXGBE_ERR_PBA_SECTION; }