From nobody Fri Sep 27 03:41:44 2024 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 4XFGVK1hmjz5XQsx; Fri, 27 Sep 2024 03:41:45 +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 4XFGVK0F8Nz4s5Q; Fri, 27 Sep 2024 03:41:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727408505; 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=BLlPJxK85BibQaRTvLCdGFRbmBiTo8ScIOJ5zUybc6c=; b=IDxLGE8g1yC6dtBiXmqrXCzQscYqGeeKmLh8VQJMe7uK+tCqJt1o+77VhSjLU2/orwg+ea CJJjqYr2PGP4TV9diYFQMC2R50MPT+al38MqiptkhrVSvBd24BnWj1AbNwTwigsN2e3GS8 IM3Fj1BazMd4lNNsQto5LZmBFlOCsGZs5LbBcGoKqvxsLTt8Z4MPAVJ0tBAZdeuhb0EZfM oxfOsGVR/mWFovHAZ8cegqIjk2vXIUxP0yqqkREdCyGpuSPOEQ4eyeycc5Cas1pGRZSvgx 8vdzsyu/8Mvx2eGnKsOUu8JA4YXwJ/sDIhUUixQRSxkzlzEN3okWSrZGifTxNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727408505; 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=BLlPJxK85BibQaRTvLCdGFRbmBiTo8ScIOJ5zUybc6c=; b=E3q7XOlrFb/StoXBXYEfHg0uhPhiIfYrD1F4BsW7NIjKID/6vJcVv7N5OfJRI44i07qrH9 tl1/VrpQLTVC+Z3ENxuDzgdBD2ETNijwzyeNCoRAbix/6ZQVYus9oINoXcELDuaMp+0NBg Y0TilicH8APAmgJQCyjgEiSVbjbiQd75J92ab6DvveRUwtVwaoZsy2+qw+up9yYTd0+9OG pX03oFYh3kGnHFSJ8NVTIKgYqiB+de8uaALfuvGdvu2PSB/sZYSvcyaTGgwYOJMC9pZT8l R0OiiRdtXgdMTPwVtD4zuM/x9BstMnOQfjCXsvn+CHI+ArEwlm/1z7cfvdgoxg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727408505; a=rsa-sha256; cv=none; b=i06/CcV2Yna8e+BTAmZyk9xjiFnyokDaogWJ7k3ydmYrX+ITD+n9RMGy1JV1l3qzv6+jER 8PMTmTEgj5UktDlmdsKTVvaQtRMFIr5o1yKcIWFlSeJogZJMb5/dH5Io3rvxLY7ExGgn0b wTk8diiU7ZttFax4aGIlrzg7DElYo4laBojIakLfzra8J+JC9Xsb6FQrg9QW9oK4TWi49F WNcN2sdw+1UUVv5U+xzybSCFRIwIo1BkofahojSzbh3+J496cTfesxMjwzgjLgvm5X6zY7 3tsT5sQ3k6GHcj8w6DAz1Bot2fS9kBPJZxXISVpM8Wt3wUVl/RyhoOUL9YubIg== 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 4XFGVJ6z9dzPbD; Fri, 27 Sep 2024 03:41:44 +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 48R3fiDq055674; Fri, 27 Sep 2024 03:41:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48R3fibF055671; Fri, 27 Sep 2024 03:41:44 GMT (envelope-from git) Date: Fri, 27 Sep 2024 03:41:44 GMT Message-Id: <202409270341.48R3fibF055671@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: 78cb32166d50 - stable/13 - ixgbe: prevent PBA read over eeprom word size 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 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/13 X-Git-Reftype: branch X-Git-Commit: 78cb32166d501dd867cced689fc9308798569b1f Auto-Submitted: auto-generated The branch stable/13 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=78cb32166d501dd867cced689fc9308798569b1f commit 78cb32166d501dd867cced689fc9308798569b1f Author: Dawid Zielinski AuthorDate: 2024-09-20 03:33:37 +0000 Commit: Kevin Bowling CommitDate: 2024-09-27 03:40:43 +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; }