From nobody Tue Nov 07 15:47:24 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 4SPszc6DkVz50Wv9; Tue, 7 Nov 2023 15:47:24 +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 4SPszc52tkz3Jr6; Tue, 7 Nov 2023 15:47:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1699372044; 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=e/9nZ/7CqxF/k68o9GznxkYwH4Xt049f2k9/OWp6hEk=; b=VVlaUh0adU1OzTH1Lej3EE+xKh46fGuG4mUM4NlQ/koQPe8IlU8gfP1T/azdCJ05IR2y9U HFnLtetjxOpWznhW92IeRwD8INGyyLJ0p9BY6Y+sDT9rSn1AR1HKVLKXV7sbIfN7f63Fic ZKUazZNFhFkAZ4JD+VKzpBsUdaDBwQfDD5f5AKL4iEqMqGtgbQzuUjQjfv4yXEAs+V8eKk rxCm/Et/Dp6WJxjrRCVnlDsM771JQslzKggvl8XQh6zLMQdZ5tOmJIuVyZdJMAWZoSfMRX VvKqC+C66Cc8lZvZX6j/eBZ48roKjvPRJMqO19RCozhC7AYplCJlwyBNAHMM2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1699372044; 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=e/9nZ/7CqxF/k68o9GznxkYwH4Xt049f2k9/OWp6hEk=; b=YKBRJNDOBoQ3kBQlHGbGjeiuv+baCi8CBdIUPg10XreU3IlD89Hv8ljTxkgo8Vf4pM2uQ+ RsosxzTogrQv5c8iTcQKps+Mh+1fKNA0Y79Lmg7gkI7VBATI2/0kXGNRRecBQYnNkDcSEC 820cJlQueCRTDuNY7GkOrJCFzxJHFqIgo5//jWslkgvzeEPYZ5Uz1J/ZTHO9+h+sR7C6Bw W65eCXlAoCGBtL9oxtigimxvcwTnlIkwefuLVD3Y0sjIvnbFgEnnysG9IBiOSj/FNS20A9 Ru9WqjTjwmtiiEcZ6NhhUupwOhetcrKBEwWlXShDd6dawK7vnn8Nl/CpggegLQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1699372044; a=rsa-sha256; cv=none; b=JlNcis7J5jkBejM4sp4r+1AdtAoyKUkqKklx+i7N5kRs4fR22ShDpMo/bDNDAz2101ak/0 eTYxEUkscePT03Ht+DQDvaxWi+xeoYgaUa9oFgtm4F8AmF5A5wX6unxxO/sxcdkFtm86in xGz2dc4iY1ify21shy7Aj8oBfl/myeVo/6zTaYX43zTTyLTXwKbCiBaMM5d5DbhHnE1Vwl 7bXU9/hpffOqzm47AU+G3+nYuQIqDXBoYMwqTX10L6w5ZSO08MaHRHej6tfHRsQrhOVk24 IWKWBE17TZYdB43wphJAK798iroBRaLPalBQWwCjD5rEOb+wWfcJHVX7NATObQ== 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 4SPszc3gF2zwC2; Tue, 7 Nov 2023 15:47:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3A7FlOqB069864; Tue, 7 Nov 2023 15:47:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3A7FlOg3069861; Tue, 7 Nov 2023 15:47:24 GMT (envelope-from git) Date: Tue, 7 Nov 2023 15:47:24 GMT Message-Id: <202311071547.3A7FlOg3069861@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: 228ae54114e1 - stable/14 - libpfctl: be more tolerant of kernel extensions 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/14 X-Git-Reftype: branch X-Git-Commit: 228ae54114e1efbe82686090bed9d2c8071ecea0 Auto-Submitted: auto-generated The branch stable/14 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=228ae54114e1efbe82686090bed9d2c8071ecea0 commit 228ae54114e1efbe82686090bed9d2c8071ecea0 Author: Kristof Provost AuthorDate: 2023-10-27 12:13:57 +0000 Commit: Kristof Provost CommitDate: 2023-11-07 15:46:52 +0000 libpfctl: be more tolerant of kernel extensions Allow the kernel to supply more array elements than expected, but cut off when we hit what we think the maximum is. This will improve forward compatibility (i.e. old userspace with newer kernel). Reviewed by: zlei MFC after: 1 week Sponsored by: Orange Business Services Differential Revision: https://reviews.freebsd.org/D42392 (cherry picked from commit 2b1eb63fc9c6d6f64baaac59b7ea7c2a3228c03f) --- lib/libpfctl/libpfctl.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/libpfctl/libpfctl.c b/lib/libpfctl/libpfctl.c index 403dbf809b89..03907698e7d2 100644 --- a/lib/libpfctl/libpfctl.c +++ b/lib/libpfctl/libpfctl.c @@ -145,9 +145,8 @@ pf_nvuint_32_array(const nvlist_t *nvl, const char *name, size_t maxelems, size_t elems; tmp = nvlist_get_number_array(nvl, name, &elems); - assert(elems <= maxelems); - for (size_t i = 0; i < elems; i++) + for (size_t i = 0; i < elems && i < maxelems; i++) numbers[i] = tmp[i]; if (nelems)