From nobody Tue Dec 17 10:08:04 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 4YCCDj0N0Wz5h0lh; Tue, 17 Dec 2024 10:08:05 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YCCDh5L18z49wK; Tue, 17 Dec 2024 10:08:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734430084; 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=ba42CCZNc+iFEJPZ8uCoCFbw2GCVTC7uAd4hsEXXKd4=; b=Dkgq+Nj4SsJmCjMBzdcl7hkwHHssD8La0fT3EdPI+9XhjzRC2wsa8F3cLRFwWQAmbDJM+q 4w69iOqtE2E9QKzxjfpHIr/CxW6aG5LxYQO/0A/7UA7RoOMhHR1vNwBWsik6B8zIq01uCB TSZA+BmBbBNfXZvoS3VqqTKTqyU8uO2PGiqmvr07++lMDzGYmxgEuQ4NlSI8+8HgXWJ5k4 +Hc8WNL1sch+xH2HPcSE7pnyiHEWpRavEwabLgO+IoK3ulmyM8Wqn8dbLJ/d2Zv7GgFa78 ZXpMeMEAq+V0M1G1eCglMC2uiNI8gLBrZWWn86r4t2POTvHzMsciB1Gv5u5/vQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734430084; 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=ba42CCZNc+iFEJPZ8uCoCFbw2GCVTC7uAd4hsEXXKd4=; b=XlcmtxEXy0xFTBP6CGbv2QnwhOByL2nIIV3NDTvFwo+5CntJqVrGinhbEezxv8tu1PGZTe U4oQQ033HjITwRqLruxIfATrGuxC0zd928hN+t0IEltLim8azOUobPshm/+5FOv6fz8kd9 UhBzkbW/qoptldYVdy49a30L7UTPRhhsjs9e4S/fJVyVtpO4mB2TRr38FMslxgHkNUNDFX Zq1bkuh0a4Pixbjmlsjsqoeb3hai1Nx0MwbR36b8k6F8cV+DMKU1fVHdoGgP3r2Xm5HoPV YxR1uS55WC7ZR5pFRctPpRPuNrkaYligj6/ti3WlohVCAoxiq0RWRZMc0iNQdg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734430084; a=rsa-sha256; cv=none; b=Ft13NxCYjP2N31d8a3jFbdnywdtNHrh3MxYn22XCWiEf4hjtCD1nmhoLOCzN3+NowyxM1X QieofvnsICoumrqr8Nfa8NHRLkjWctTd5fyL2yZTt4SmU5xpqSryOP9mOYZqsLL8QdoykZ RG7321mE0JBimKDnc3eQsgl7iAqDSIzYoNIG+RtTyYdGYDoJVgkEqKUthvkjES/+7HD8tq ApfhwlMuEwvdsZDnP3i4Bimm+gd2ctAa7sVuqIwD0DnAdfhly+yrQMGAfApsfZXhjVn0wr kqonphRyJ3NhQlcglY5Ybx15aALKLFVZsEWU5c9PXMI/Mq0Kg74LnvDuJAo+kQ== 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 4YCCDh4Y9CzJVM; Tue, 17 Dec 2024 10:08:04 +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 4BHA84ux024462; Tue, 17 Dec 2024 10:08:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BHA84V2024459; Tue, 17 Dec 2024 10:08:04 GMT (envelope-from git) Date: Tue, 17 Dec 2024 10:08:04 GMT Message-Id: <202412171008.4BHA84V2024459@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: 6c5c91a039c7 - main - pf: update pd->tot_len after reassembly 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: 6c5c91a039c77244dac38f638a8e2323ae78ff3d Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=6c5c91a039c77244dac38f638a8e2323ae78ff3d commit 6c5c91a039c77244dac38f638a8e2323ae78ff3d Author: Kristof Provost AuthorDate: 2024-11-21 14:53:28 +0000 Commit: Kristof Provost CommitDate: 2024-12-17 10:07:16 +0000 pf: update pd->tot_len after reassembly Ensure that the packet length we track in struct pf_pdesc matches the reassembled packet size. Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D47803 --- sys/netpfil/pf/pf_norm.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/netpfil/pf/pf_norm.c b/sys/netpfil/pf/pf_norm.c index 350392623123..cea6f9e72638 100644 --- a/sys/netpfil/pf/pf_norm.c +++ b/sys/netpfil/pf/pf_norm.c @@ -1198,6 +1198,7 @@ pf_normalize_ip(struct mbuf **m0, u_short *reason, return (PF_DROP); h = mtod(pd->m, struct ip *); + pd->tot_len = htons(h->ip_len); no_fragment: /* At this point, only IP_DF is allowed in ip_off */ @@ -1228,6 +1229,7 @@ pf_normalize_ip6(struct mbuf **m0, int off, u_short *reason, struct pf_pdesc *pd) { struct pf_krule *r; + struct ip6_hdr *h; struct ip6_frag frag; bool scrub_compat; @@ -1294,6 +1296,8 @@ pf_normalize_ip6(struct mbuf **m0, int off, u_short *reason, pd->m = *m0; if (pd->m == NULL) return (PF_DROP); + h = mtod(pd->m, struct ip6_hdr *); + pd->tot_len = ntohs(h->ip6_plen) + sizeof(struct ip6_hdr); } return (PF_PASS);