From nobody Wed Jun 21 14:33:21 2023 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 4QmQwL0d6Yz4g9bR; Wed, 21 Jun 2023 14:33:22 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QmQwK6B5qz3Dnn; Wed, 21 Jun 2023 14:33:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1687358001; 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=oOSZ/zrXj8OzbNyhQLv8PIvaG+u9Wk1fIiJ0gqFa+YE=; b=SHj1OwPOPr6SPGJqCMB3pjfkgrvfccyrgMvQUKm1KSVgHBDdGq/AcZAgUwIpGJZEddcTo5 1ngFboDO5vcrITW1J+y/bc7EmZT3kd1G5vFz9JhMIO/1q/MXPTNL6J9Xb0J5LvcI50d2oP 1gJxSR+6YROFfLxoQQKyupEt8JPxuR/ljriZswqcCM+tZJh6NCoVVy4E1LPxqR3ViNQNCH dweTaDd1HfCMSo9XicVIEbBsV2jzaWFqVRyuZr5sI96WH9EgTcLB3/58QtDtlRhIED4l83 m1n6F3Y1gYKCtxvbkTsAD/Xo+JtdnYU2GV5eyVpgA7Hs03A5woPRr37CmypfxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1687358001; 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=oOSZ/zrXj8OzbNyhQLv8PIvaG+u9Wk1fIiJ0gqFa+YE=; b=FFHbgnzSKdEIba5IiOJJcW8iV67uX0P6nJDV7RGg5jvL2TH0aFPEW7VOZX5GaSLHgOAXU5 1tL+lp3JZ42eAGenOQ2AAY53SluqtG1bFbJqvShUN2MGKl8GhOCRIwiMmvaXHblIi2VKJV /wJt8FWfi0rgxfawg0XKXCm8ZqPKGx/qjkcYz+5eAZgU//o1tTrmalsD5JFKiRduz226wL Eu7bMwvVdDNBVGTXsxkljUaK43cvtnimvy9YSbS4rQQlE6IUZ9wUZ1NLTxD8NJQG78SLGC +3Bvi0C2LuFCwK4LiaDrrpLbTNi4gJArrpnLRibwXjKd33V4lr0y2g2LqxDbnA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1687358001; a=rsa-sha256; cv=none; b=WXFZyZzSfpJw8iq3yVwh3yP4yTMTmINhekB6SuReao2+VMk6lRf4Kntt0dBaWlHMHqcige pFlF+9rEQa+wkHr5K3jCtPOsfoCd6+MaFCbDFLsT/ofYhUyy0lCIxSfjgD1FbRkBuvj40c yC50d9wByGYNwmwDvJAuX7OZd+Zg+lynZzvNF2f13IFodjX92jgc59JF75oh/m3zboZzrs tycb1ju++2vj5COfFABts4fAA5hWXVVS0/sD9muWqCZWpOmcakVAsQ24Xy6gXb1I1RCatg m+fqTBvRWdjWkyYBmVkDe6jIt4zW05/PA9aIK44O+2ZUSZ1+/gE6ptSs/oXGBg== 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 4QmQwK5F9Lzl8W; Wed, 21 Jun 2023 14:33:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 35LEXLib040414; Wed, 21 Jun 2023 14:33:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 35LEXL11040413; Wed, 21 Jun 2023 14:33:21 GMT (envelope-from git) Date: Wed, 21 Jun 2023 14:33:21 GMT Message-Id: <202306211433.35LEXL11040413@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 48bb8ea97e22 - stable/12 - pf: fix pf_nv##_array() size check 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 48bb8ea97e22ebfdd7acf5ce95d82ccc38a800e4 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=48bb8ea97e22ebfdd7acf5ce95d82ccc38a800e4 commit 48bb8ea97e22ebfdd7acf5ce95d82ccc38a800e4 Author: Kristof Provost AuthorDate: 2023-05-15 17:40:32 +0000 Commit: Kristof Provost CommitDate: 2023-06-21 14:29:18 +0000 pf: fix pf_nv##_array() size check We want to set the maximum number of elements we'll accept, not the exact number we need. MFC after: 3 weeks Sponsored by: Orange Business Services (cherry picked from commit 76c8f202a4f6a3190e102a0bc1589bbfc179abf6) --- sys/netpfil/pf/pf_nv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netpfil/pf/pf_nv.c b/sys/netpfil/pf/pf_nv.c index e2af55af86e5..11f99ce23fac 100644 --- a/sys/netpfil/pf/pf_nv.c +++ b/sys/netpfil/pf/pf_nv.c @@ -77,7 +77,7 @@ __FBSDID("$FreeBSD$"); if (! nvlist_exists_number_array(nvl, name)) \ return (EINVAL); \ n = nvlist_get_number_array(nvl, name, &nitems); \ - if (nitems != maxelems) \ + if (nitems > maxelems) \ return (E2BIG); \ if (nelems != NULL) \ *nelems = nitems; \