From nobody Fri Sep 27 03:36:23 2024 X-Original-To: dev-commits-src-branches@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 4XFGN751Thz5XQQV; Fri, 27 Sep 2024 03:36:23 +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 4XFGN72ksgz4nZ7; Fri, 27 Sep 2024 03:36:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727408183; 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=OlZ/IB5wD112JsDPzN1Cmgn+1fhcWQIVbpIqz/745do=; b=Aa1AGHkA8PSQG0+uY/RzTBmIWNeh2Lj47HOYHbMu2V6dMpEyM0Eo8fzifDZTGyTeQjkVbb wq75RaahIKUWA1y/bgeFRuRaD+lXtgG+unj5wdMwTyzvve6imM3GEAa5Lw7XNqW4WrcA1Z 8t2vWtPqXG43zZeJC/IvDZXUQf0Q+MC/HAlsMOqFTajwa/ydy7kBbf/JxY0fiXhdswqysZ xJzKg1ZELtVhZk3v8ucVs6ykOkSHvCUYvNwebUHqYU5pBNE5iU+8AfGu9i1fL9TZh/Q9TU GiV8oX8uBBxvQLUMlqiO3exCJtaTg17V8zKZ6qdg1z7KV3/0YGWCWy913WzmzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727408183; 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=OlZ/IB5wD112JsDPzN1Cmgn+1fhcWQIVbpIqz/745do=; b=N3fC1E51AAHlhNSjZvLp8dwb3vOU7LgBE41sTnsMZAGMzG2FI7UBNC8IfrBBdsidPZTFx8 r3O+rp2+wJLUBX//odTw2vFujcbyFr0b2Llw72tGBBi+6g4SxDDbgiG5P3aK6f7X92/Cg/ cIBrG8Nt9zca9i1/o+lcgjA+DfR1O0w4zcOLWjCq8m+BvzH0GCkM+QpXR19iujX5avIDjV i3pYZzxTg5C3lMgQosnCi9Cef2ZAq4DYmlv3yr0I821kjezgJsKlHbNQtWaMPdJu68OwQF 5waTL+620p7WYeg7OUTJD0+ETGjJatr2wGt0srxaMXtw4Ocn7ENM8GXwV9VlEw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727408183; a=rsa-sha256; cv=none; b=rSc43hM2yxOiFjkXKjmurWXL1Zue/B3DNrcdL/tIkkIdgq7BdyFdLTz0HIMXxVymtxIHnl aphR+Mdy2ZWUz4Z1lu9UA43BwhgTQObsClQGrYJZEm7cbrpAGRATKfSFCElTfXsJWfcbiG 8vMfvmks4eBk2y7r+RsEU3KCYhttPawvRW/dXLeLGyFcj9VCMF651YcDL2usIsvSWBHNn1 eagJatzhXa3o0dhFaXa4QrOwJr8djqsa1s5NsuO4cYkEh39J2mnzgvSDpY92JnTYninBm+ 0I8PcmXxpJzc/meHSwukRa5yNxnuK9CveAlT62Xpd0BsVD1P/kOClIasYOqf8A== 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 4XFGN729VXzNx3; Fri, 27 Sep 2024 03:36:23 +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 48R3aNrb039261; Fri, 27 Sep 2024 03:36:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48R3aNiY039258; Fri, 27 Sep 2024 03:36:23 GMT (envelope-from git) Date: Fri, 27 Sep 2024 03:36:23 GMT Message-Id: <202409270336.48R3aNiY039258@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 0ea3d1ca5e27 - stable/14 - ixgbe: prevent PBA read over eeprom word size List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: 0ea3d1ca5e27b0af2573e0d7ca83ba5d113ed1c5 Auto-Submitted: auto-generated The branch stable/14 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=0ea3d1ca5e27b0af2573e0d7ca83ba5d113ed1c5 commit 0ea3d1ca5e27b0af2573e0d7ca83ba5d113ed1c5 Author: Dawid Zielinski AuthorDate: 2024-09-20 03:33:37 +0000 Commit: Kevin Bowling CommitDate: 2024-09-27 03:34:39 +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) (cherry picked from commit 25771c8c1ae606436823854de01fc2b23178e353) --- 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; }