From nobody Tue Aug 20 12:18:44 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 4Wp7mN3gnTz5T1cJ; Tue, 20 Aug 2024 12:18:44 +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 4Wp7mN2pxBz4QFg; Tue, 20 Aug 2024 12:18:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724156324; 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=xNRGKrmiHVXfXcudmRTor7f3NfYyEp3jFvFuwMujrgo=; b=geN8QfZjCQ8I8iR6/FKDAlJQl2SaqOMYBOItRUBp25+g2jkC+bzDrQsZDV2zRRIpwrKkzv C6sK7YCuRlR1+w2qYpBiV4xtKNCfTZRRA0JmeBLBRHnie9nHRCZXHX5WUI8YifU7yTPyX6 V7X7QhmnMljtTjc61qBJSKc5QOAv07P0mICUvuMjA7ZBF9HUNwjRIoa/Ra+EO0wTNTMvPd U3GR5MX403v7iql3S7XlcSIW99OcFskz1CvnhmjQFqbSnyn6lshO2ud4H5RdTHv6xbXsy7 jwIdtoeNluTvSq7NHTs66G3zN/qxs8iGGWiQhpi6IJw4yYk/1XShqnNw/2Fx5Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724156324; a=rsa-sha256; cv=none; b=BPM39Gu5P8J1jTCPnGWj8GqfDa0YTO2DRWz+pMqByqVAWxnPM56ywDxWIh4yeoYbRP1yPO 2ClSLGViW5h0yjTRn4pIgwnqIwmBrO/UsY/mBP8yJZpzcSTxXbPYQk/UVEqb+yN5UPfzWU P3wgIqLNkPC7A3OoQ1c+KjYdibTTcW4jy2//P3s86TtcB9pUjqH4RnO15Jizkm/bVw3FO4 6KwwEkrAAxF8FrkVDZMdGCHpZxJ/x6hNPrwaEKG6MddJ33NjCH1n/U95BjRQjJ3V5Cv3Do bHXTr+UcI+8/Wejx6ZFp4m8zP3GQpfaPe3koR3UhmoXww4W7sSmUMDRZEoziBw== 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=1724156324; 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=xNRGKrmiHVXfXcudmRTor7f3NfYyEp3jFvFuwMujrgo=; b=TLpqSqB1Lw+gEL20BM1g/NdSi61qnQ9zew7ysswNUFHb+lUfEgLScP0Ruw7CH1tlgEBBe7 Lj5Yf1nb2tVeYbzst0qwk5sXAGuNEVgOkFL4ZDFJfD16EqsDS2Y3GJRYzaQWrXtRqdcFpd xAxu8ygSOeEMYX2GmeNLDMB+ZgRXWlIab/AmfS7zDudz7sSCv7zhxy1YFEkOS3M0CELf+J aFUorgFG6Wr+Ide9WDzzUVse5YdprIDNIix83XQki/WAS3HALqAa8rMzy+4lDqakoo4w4V x5TYX4SbafQ+ktaQZSv34nNMxOmm8X6W4F858ctix3sIQxYWqP8xvzK4QbVOrA== 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 4Wp7mN2JXqz10kQ; Tue, 20 Aug 2024 12:18: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 47KCIiVn003732; Tue, 20 Aug 2024 12:18:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47KCIi5i003729; Tue, 20 Aug 2024 12:18:44 GMT (envelope-from git) Date: Tue, 20 Aug 2024 12:18:44 GMT Message-Id: <202408201218.47KCIi5i003729@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: 7d12558904ca - main - pf: Make pf_test predict that m_len < sizeof(struct ip) is false 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: 7d12558904ca5b6f830a4ba9f7b1f8ba119bc5e3 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=7d12558904ca5b6f830a4ba9f7b1f8ba119bc5e3 commit 7d12558904ca5b6f830a4ba9f7b1f8ba119bc5e3 Author: Igor Ostapenko AuthorDate: 2024-08-20 10:02:56 +0000 Commit: Kristof Provost CommitDate: 2024-08-20 12:17:59 +0000 pf: Make pf_test predict that m_len < sizeof(struct ip) is false Reviewed by: kp Differential Revision: https://reviews.freebsd.org/D46374 --- sys/netpfil/pf/pf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 9b1601ac0ee5..ad2dc2e707ed 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -8354,7 +8354,7 @@ pf_test(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, pd.af = AF_INET; pd.act.rtableid = -1; - if (m->m_len < sizeof(struct ip) && + if (__predict_false(m->m_len < sizeof(struct ip)) && (m = *m0 = m_pullup(*m0, sizeof(struct ip))) == NULL) { DPFPRINTF(PF_DEBUG_URGENT, ("pf_test: m_len < sizeof(struct ip), pullup failed\n"));