From nobody Tue Jun 4 17:44:55 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 4VtyfH4FFmz5MHlm; Tue, 04 Jun 2024 17:44:55 +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 4VtyfH2JxSz4L6J; Tue, 4 Jun 2024 17:44:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717523095; 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=KVx/8Wh4hm1ahYyBEgsdTro4Zd9BQh3xmhzoSyQpp1E=; b=YBwhCLYFw8Eatr8FiQUCyaRP0rGsvVyfslgut3+HsmttdK/ISxyP0wli8uFXWOr2Gr5qAn WC8rQ5bJsEUdTOBtbRVkxkQdGnZeqc+c4Fohah41yTzqgBP35lkSKAup7qFPBrDz1bOkiy inZWfZG/Z+TQtmaRdY57/KxiGFO71+dsHvCA3s3TIzM/u9VO4jT3ekZZcK5Zck64sgh3Yy 309dGm6lL2JQtzuz4lzcG1apHIGxNqZGIA0sdmkin9s4XNdwDvLlaPm/+3XopH/YK01TS1 5oVoRyLxSPK/6Yx3xcaFHaSd0IMH3V1RW8dbtFRmvUdnmA+4DWGDOsyUa9OEsA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1717523095; a=rsa-sha256; cv=none; b=Vrd1kX1TnDYSMxCLupu6czf6Lj+hGbK2Di00EtQo0Z7QeEdY5MeCnb/y7Eb0Sfnj+BRNN5 MFojYpB9Y4L9FyVVsSt6gtx0TPYicHo7Y4fWZ+J/LLoCtdb2x7V+/idvCP+MXbalmx/kbO s/RIe8lTmf/7QMqSYJgOGt/x2Wnmzbu2J6msthX3+MVCOhnRs4ArOz7lDkaoYtAOTsO4OA gy+KMEL1N75JtGLeRQKof3f7ygiYEn+QWtexBd9BQnmZpLBrrn/csBxGgO/7dYy77tdXZr KHxqtkvTfSQ5HWn1vW+SjsxHyupVEe7C5Cnlc3PlMpnSeypzDpz1WC624JN4qA== 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=1717523095; 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=KVx/8Wh4hm1ahYyBEgsdTro4Zd9BQh3xmhzoSyQpp1E=; b=P43/CWdCk88IJ0FQqKvn3G7tFJvAKI4JGSW0bTbK5uqrY9OBBwgNCknYOR2R7XGDLKlFG6 JiV3WfbuHfp12pineiGD3F4ez4xz6X+avOnqQV/WwlYnU26SyAOh9ny5tKo1K3Bmn9Iuj+ 8nPu1wVw21KuFONjsx4K5wQLqtCBKZ+SXIpZmYzeg2NEjs8yM+uy2/tp7o/KwfVB9E0r06 o/bYox/kLJwg61ZBB7AJRWFYO9yywNLqXh83rS/jkkl705ygnRzb3XVHA2/mNcCHFn9ts8 3mvk7AYjIcmwI/8WaBhrDPPdPUZQbWtBl/aHTPYqI86rZCn+4VO/5muYnf1Iog== 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 4VtyfH1w4TzSN9; Tue, 4 Jun 2024 17:44:55 +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 454Hitw1037105; Tue, 4 Jun 2024 17:44:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 454Hitud037102; Tue, 4 Jun 2024 17:44:55 GMT (envelope-from git) Date: Tue, 4 Jun 2024 17:44:55 GMT Message-Id: <202406041744.454Hitud037102@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 84ff9e9122ac - main - pf: fix overly large memcpy() 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: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 84ff9e9122acf23252680784724d6d565e734d31 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=84ff9e9122acf23252680784724d6d565e734d31 commit 84ff9e9122acf23252680784724d6d565e734d31 Author: Kristof Provost AuthorDate: 2024-06-04 15:29:13 +0000 Commit: Kristof Provost CommitDate: 2024-06-04 17:44:20 +0000 pf: fix overly large memcpy() We only want to copy the labels array, we don't want to copy the counter as well. Reported by: CheriBSD Event: Kitchener-Waterloo Hackathon 202406 --- sys/netpfil/pf/pf_nl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netpfil/pf/pf_nl.c b/sys/netpfil/pf/pf_nl.c index 1074c561cd15..cf5146c716c6 100644 --- a/sys/netpfil/pf/pf_nl.c +++ b/sys/netpfil/pf/pf_nl.c @@ -532,7 +532,7 @@ nlattr_get_nested_pf_rule_labels(struct nlattr *nla, struct nl_pstate *npt, cons if (error != 0) return (error); - memcpy(target, parsed_labels.labels, sizeof(parsed_labels)); + memcpy(target, parsed_labels.labels, sizeof(parsed_labels.labels)); return (0); }