From nobody Mon Feb 13 08:20:53 2023 X-Original-To: net@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 4PFcjf0rZ8z3pjSc for ; Mon, 13 Feb 2023 08:20:54 +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 4PFcjd6RrFz3FVs for ; Mon, 13 Feb 2023 08:20:53 +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=1676276453; 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=3zPe8F/Q5cpRnh793L35dpvVfK9Ewo3pUfyYEkFQv4o=; b=dJkb5JcTtypOHBHApGI9fm6Fw4vlOIs3FDg0HJQJALzpeNO/SzDPxuMAuKfz7rf6r3gk9U +HHva9AoEWU8SuRuVG79XnBB8rRBe5twK+0JaXjM0Y4wbF7b/XDTgkRQJSBXZD1A5wHw20 /F5OOyEEBce/YPWmfXsivTvOFOQnjGrwiz1ONvFYJCvTMxwhqKg1LgZZ4YLCSDVGxDIq1d hTkiBju+iYHdThqM+bLvliORXNSJZsGwbK+mE/F9Q7D2s65XMA5GON5h75yJY0z1zm2GzR a0rTcPu0ZiF574X6NDNIbdBHegDJXTqAwftmT3AOf5qZVWKRQHbDmuauyVbagQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676276453; a=rsa-sha256; cv=none; b=s5aHnVSXGX23tY6/xCnscCPCsZNLV89mEW90m5kNsm9zc/sB4XcV/K/z2MHlm6sXVQ7qje ubwZPPi+x6BqbzDiE/C/ua7BWIe8PRuG9meBokWjGBQSbufsRpO1F1MkgtjfaNjOn4rsPL Ni2K45TD17FhRMWg93iYexLd1VGSKOzjUUP9PK6k+zMLN3iTJXjYN0UmQfHNhFg+JBEDkZ HRVvrg0/KM+UN6AzFu9on/L4dy8SIL3C66+6A1CvneSO7o48cQz+1tFPuXl61Y8x0VeyKh yxjkWeecHMxCuQhFtI3PmFsD8UgySs7JJCuAjibZTQgud/rQifqOnXrRh74kog== 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 4PFcjd5YmFz19yQ for ; Mon, 13 Feb 2023 08:20:53 +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 31D8Krfn004540 for ; Mon, 13 Feb 2023 08:20:53 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 31D8KrhY004529 for net@FreeBSD.org; Mon, 13 Feb 2023 08:20:53 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: net@FreeBSD.org Subject: [Bug 268246] crash and panic using pfsync on 13.1-RELEASE Date: Mon, 13 Feb 2023 08:20:53 +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 Some People X-Bugzilla-Who: kp@freebsd.org X-Bugzilla-Status: In Progress X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: net@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: Networking and TCP/IP with FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-net List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-net@freebsd.org MIME-Version: 1.0 X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D268246 --- Comment #72 from Kristof Provost --- I'm still failing to reproduce, but this should be close to a real fix: diff --git a/sys/netpfil/pf/if_pfsync.c b/sys/netpfil/pf/if_pfsync.c index 47c3217f399c..4ebd304b1c13 100644 --- a/sys/netpfil/pf/if_pfsync.c +++ b/sys/netpfil/pf/if_pfsync.c @@ -102,6 +102,9 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include + #define PFSYNC_MINPKT ( \ sizeof(struct ip) + \ sizeof(struct pfsync_header) + \ @@ -2325,7 +2328,8 @@ pfsyncintr(void *arg) struct pfsync_softc *sc =3D arg; struct pfsync_bucket *b; struct mbuf *m, *n; - int c; + struct ip *ip; + int c, error; NET_EPOCH_ENTER(et); CURVNET_SET(sc->sc_ifp->if_vnet); @@ -2345,15 +2349,26 @@ pfsyncintr(void *arg) n =3D m->m_nextpkt; m->m_nextpkt =3D NULL; + ip =3D mtod(m, struct ip *); + /* * We distinguish between a deferral packet and our * own pfsync packet based on M_SKIP_FIREWALL * flag. This is XXX. */ - if (m->m_flags & M_SKIP_FIREWALL) - ip_output(m, NULL, NULL, 0, NULL, NULL); - else if (ip_output(m, NULL, NULL, IP_RAWOUTPUT, &sc->sc_imo, - NULL) =3D=3D 0) + if (m->m_flags & M_SKIP_FIREWALL) { + if (ip->ip_v =3D=3D IPVERSION) + error =3D ip_output(m, NULL, NULL, = 0, NULL, NULL); + else + error =3D ip6_output(m, NULL, NULL,= 0, NULL, NULL, NULL); + } else { + if (ip->ip_v =3D=3D IPVERSION) + error =3D ip_output(m, NULL, NULL, IP_RAWOUTPUT, &sc->sc_imo, + NULL); + else + error =3D ENOTSUP; // When we add p= fsync over IPv6 + } + if (error =3D=3D 0) V_pfsyncstats.pfsyncs_opackets++; else V_pfsyncstats.pfsyncs_oerrors++; --=20 You are receiving this mail because: You are the assignee for the bug.=