From nobody Thu Jun 22 22:10:41 2023 X-Original-To: bugs@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 4QnF1Z2F5jz4gFw9 for ; Thu, 22 Jun 2023 22:10:42 +0000 (UTC) (envelope-from bugzilla-noreply@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 4QnF1Y5vXkz3R2n for ; Thu, 22 Jun 2023 22:10:41 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1687471841; 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=6PaSYN+TrvsVoyugAoH7DrNDkAk28VV/RwKZZ9/B3/8=; b=puVlYCDKViLOVWEjrXnTBPVTJuXXv45HX3xBGHPFTUcF/gOe3CJWEHKxE7/mdgoH2xc2cg NeO5FE8p9XmYou1rpzPCqoXNhsji2KsaTIM8uXotnSpO9TWgqzhB9qzh1MVj0eU8RBKyaO RKFIwDDOaArUIHfUUXUZYTySn/yFlFObPbc1LBZjD6/vFqATIT3wZrl6AVSv0+eGR0JrjS mnRjotSICOituZYX4VxAKm1ik8neVD6PmvT6ap5ZJmXOxqLR/O1ZaoFRcT0oVRog5ep5bV ISQW9031QpA3P/HrsEQePRBXWtdv/ww/FVCXj5356sv9lTI3Jvxw5h9F4NE3XA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1687471841; a=rsa-sha256; cv=none; b=JmnC9Cl1nILT5zBPO6p8cdGPSPd8EEVZzZLtOj0mBLFmUw3/NACOLCWbUOVWXlpHFLoTFt 6VTC/dNf0LP4nYNrNC4+hvj55AA8gH/bF6UZVgDGDlBveHEoxZ/5i2RcFKzc62EtgQ4cre WjmxQDZJW+RV8lMuDOlQbvDW75pfvEXfV1odEhPDMZZ9Z6yhpRQrRD2NPKerZ+1xrcJ4xM ZfGHX2l5rAMiALb6FB9c/+ZvRvzl8Po84iKL12XAatyFHn3eW8D7aePRqiPDiU9iUwdjOk cLv58dRzvytEZm9d9aNuSSzMbHTmG1sJUjMyImsCRwvsdiml1AM4YIHnxGjPEA== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (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 4QnF1Y4yZYzgBK for ; Thu, 22 Jun 2023 22:10:41 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 35MMAfON082186 for ; Thu, 22 Jun 2023 22:10:41 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 35MMAfIn082185 for bugs@FreeBSD.org; Thu, 22 Jun 2023 22:10:41 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 272153] [pf] [pfsync] Incomplete state sync causing null pointer dereference Date: Thu, 22 Jun 2023 22:10:41 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 13.1-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: adam.stradtner@gmail.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D272153 Bug ID: 272153 Summary: [pf] [pfsync] Incomplete state sync causing null pointer dereference Product: Base System Version: 13.1-RELEASE Hardware: amd64 OS: Any Status: New Severity: Affects Only Me Priority: --- Component: kern Assignee: bugs@FreeBSD.org Reporter: adam.stradtner@gmail.com I have a pair of OPNsense firewalls, based on FreeBSD 13.1. They are config= ured as an HA pair with state synchronization via pfsync. I am experiencing rand= om crashes stating: Fatal trap 12: page fault while in kernel mode cpuid =3D 3; apic id =3D 06 fault virtual address =3D 0x0 fault code =3D supervisor read data, page not present One of the OPNsense maintainers looked at a core dump and found this cause being a null pointer dereference: #17 0xffffffff8237ed0f in pf_test_state_udp (state=3D, state@entry=3D0xfffffe001099b828, direction=3D, kif=3D, kif@entry=3D0xfffff800245b3a00, m=3Dm@entry=3D0xfffff801e9409800, off=3D20, h=3D, pd=3Dpd@entry=3D0xfffffe001099b758) at /usr/src/sys/netpfil/pf/pf.c:5086 5086 if (PF_ANEQ(pd->src, &nk->addr[pd->sidx], pd->af) || (kgdb) list 5081=20=20=20 5082 /* translate source/destination address, if necessary */ 5083 if ((*state)->key[PF_SK_WIRE] !=3D (*state)->key[PF_SK_STACK]) { 5084 struct pf_state_key *nk =3D (*state)->key[pd->didx]; 5085=20=20=20 5086 if (PF_ANEQ(pd->src, &nk->addr[pd->sidx], pd->af) || 5087 nk->port[pd->sidx] !=3D uh->uh_sport) 5088 pf_change_ap(m, pd->src, &uh->uh_sport, pd->ip_sum, 5089 &uh->uh_sum, &nk->addr[pd->sidx], 5090 nk->port[pd->sidx], 1, pd->af); (kgdb) p nk $10 =3D (struct pf_state_key *) 0x0 I subsequently disabled pfsync and that has resolved my crashes. It appears= the state sync is bringing invalid states with it, which eventually causes a ke= rnel panic. --=20 You are receiving this mail because: You are the assignee for the bug.=