From nobody Thu Jan 12 09:06:56 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 4NszFX6mLWz2p3WL for ; Thu, 12 Jan 2023 09:06:56 +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 4NszFX3ncpz3y0B for ; Thu, 12 Jan 2023 09:06:56 +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=1673514416; 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: in-reply-to:in-reply-to:references:references; bh=VF8k+Li5HQX7Dwnvx9fT/o4H3KOaplk8IgVxxBaHWcs=; b=TH0FDEKAUy94bZXdfPAoEAxG301Z2RXHN+/pzmvrsuKIfIbLHtRmHD9kCg0cV9hGMED0AO LTcuLzlhjup7gr3tgs9/Iyt+b5vP9p7obeo8PZF8M+guZPI12hgs2hu1/l1Rw0V2TfIYZp 85pZ8nui7PVEaY6xdi/ENONRB1C4rQmZK0tn8E1z1od9mSExpePQh7znlmUR/wwSoiiOO2 EjRZ3itLkjFdDtl5R0EdenA+7gOyDsR2x1Fg45sxnsP7FES5ZY0LmRSKzGStVbTLDtqFet oeqrgpqOAItaBGbG/e+hDgOB6XsPQN2t7Ew1IQ7jrhj3dvdVn+AO2+d5OfAKxA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1673514416; a=rsa-sha256; cv=none; b=Y1kiwCGMLyBHSRiLVdZeZrY+g/RLl6mngYWZEBFJ8rkj0ZSazOp3znLH0W1OUkYpD4eCPr MKh8U0OoElxaMnIDsmSvVJU9c853mJ5nrYLbErBfHBBQcjHqsTfEGRI19D86Je3Ple8Hz1 xdDf5P3dsEl19oRCVlJTdqM6qvyNCe3G3k8+OdXQZxC1+kKiCVDz+r6AgJjpQCmVvaDCg/ HYmOV15vOZO/4n1r70BAzjQ6wp666MbbYcp3HXH4V9sYCLJIKZ2F/eu4I2hCQPALbrkx4d wQ0Azcwt4lCesbRy1oVRzKVHSshnui1LLGTNXpOEMq1PtPCjDG71cRDwQ6e6vg== 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 4NszFX2n0GzMlC for ; Thu, 12 Jan 2023 09:06:56 +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 30C96u3d096947 for ; Thu, 12 Jan 2023 09:06:56 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 30C96uNp096946 for bugs@FreeBSD.org; Thu, 12 Jan 2023 09:06:56 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 268246] crash and panic using pfsync on 13.1-RELEASE Date: Thu, 12 Jan 2023 09:06:56 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 13.1-RELEASE X-Bugzilla-Keywords: crash, needs-qa X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: kp@freebsd.org X-Bugzilla-Status: Open X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: 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=3D268246 --- Comment #22 from Kristof Provost --- (In reply to jjasen from comment #21) Okay, so I think I see what's going on here. Essentially what's happening here is that we need to know what vnet we're in because we're in a callout and those don't belong to specific vnets. We got from that the mbuf's received interface, but that's not set for locally originated traffic, so we panic dereferencing a NULL pointer. Happily we also have a pointer to the pfsync interface, and we can just get= the vnet pointer from there. I've not been able to meaningfully test this myself, because today there are not a lot of internets around where I'm staying. This patch is against main, but should just apply on stable/13 as well. diff --git a/sys/netpfil/pf/if_pfsync.c b/sys/netpfil/pf/if_pfsync.c index a2baf477873e..05c80ae725ea 100644 --- a/sys/netpfil/pf/if_pfsync.c +++ b/sys/netpfil/pf/if_pfsync.c @@ -1819,8 +1819,11 @@ pfsync_defer_tmo(void *arg) PFSYNC_BUCKET_LOCK_ASSERT(b); + if (sc->sc_sync_if =3D=3D NULL) + return; + NET_EPOCH_ENTER(et); - CURVNET_SET(m->m_pkthdr.rcvif->if_vnet); + CURVNET_SET(sc->sc_sync_if->if_vnet); TAILQ_REMOVE(&b->b_deferrals, pd, pd_entry); b->b_deferred--; The other issue I still don't understand, but once you've tested the above patch it'd also be useful to test pfsync without defer mode. I wonder if the problem is related to that. --=20 You are receiving this mail because: You are the assignee for the bug.=