From owner-freebsd-net@freebsd.org Thu Jul 23 08:09:31 2020 Return-Path: Delivered-To: freebsd-net@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5C1123759D9; Thu, 23 Jul 2020 08:09:31 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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 "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BC4k31rjvz4DQR; Thu, 23 Jul 2020 08:09:31 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from venus.codepro.be (venus.codepro.be [5.9.86.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx1.codepro.be", Issuer "Let's Encrypt Authority X3" (verified OK)) (Authenticated sender: kp) by smtp.freebsd.org (Postfix) with ESMTPSA id E7E0E17F2D; Thu, 23 Jul 2020 08:09:30 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: by venus.codepro.be (Postfix, authenticated sender kp) id 6D7823D5E4; Thu, 23 Jul 2020 10:09:29 +0200 (CEST) From: "Kristof Provost" To: "John-Mark Gurney" Cc: "Bjoern A. Zeeb" , freebsd-net@freebsd.org, freebsd-current@freebsd.org Subject: Re: somewhat reproducable vimage panic Date: Thu, 23 Jul 2020 10:09:25 +0200 X-Mailer: MailMate (1.13.1r5671) Message-ID: <6847FB6B-0B1A-43C7-B567-15BF21AB5D56@FreeBSD.org> In-Reply-To: <2FFC49F9-83DE-4FA1-A47F-1D8A7AF4B241@FreeBSD.org> References: <20200721091654.GC4213@funkthat.com> <20200721113153.42d83119@x23> <20200721202323.GE4213@funkthat.com> <38F5A3A6-B578-4BA4-8F69-C248163CB6E0@libassi.se> <20200722060514.GF4213@funkthat.com> <20200722193443.GG4213@funkthat.com> <6C149617-55BB-4A87-B993-195E5E133790@lists.zabbadoz.net> <20200722221509.GI4213@funkthat.com> <2FFC49F9-83DE-4FA1-A47F-1D8A7AF4B241@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jul 2020 08:09:31 -0000 On 23 Jul 2020, at 9:19, Kristof Provost wrote: > On 23 Jul 2020, at 0:15, John-Mark Gurney wrote: >> So, it's pretty easy to trigger, just attach a couple USB ethernet >> adapters, in my case, they were ure, but likely any two spare >> ethernet >> interfaces will work, and wire them back to back.. >> > I’ve been able to trigger it using epair as well: > > `sudo sh testinterfaces.txt epair0a epair0b` > > I did have to comment out the waitcarrier() check. > I’ve done a little bit of digging, and I think I’m starting to see how this breaks. This always affects the jailed vlan interfaces. They’re getting deleted, but the ifp doesn’t go away just yet because it’s still in use by the multicast code. The multicast code does its cleanup in task queues, so by the time it gets around to doing that the ifp is already marked as dying and the vnet is gone. There are still references to the ifp though, and when the multicast code tries to do its cleanup we get the panic. This hack stops the panic for me, but I don’t know if this is the best solution: diff --git a/sys/net/if.c b/sys/net/if.c index 59dd38267cf..bd0c87eddf1 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -3681,6 +3685,10 @@ if_delmulti_ifma_flags(struct ifmultiaddr *ifma, int flags) ifp = NULL; } #endif + + if (ifp && ifp->if_flags & IFF_DYING) + return; + /* * If and only if the ifnet instance exists: Acquire the address lock. */ diff --git a/sys/netinet/in_mcast.c b/sys/netinet/in_mcast.c index 39fc82c5372..6493e2a5bfb 100644 --- a/sys/netinet/in_mcast.c +++ b/sys/netinet/in_mcast.c @@ -623,7 +623,7 @@ inm_release(struct in_multi *inm) /* XXX this access is not covered by IF_ADDR_LOCK */ CTR2(KTR_IGMPV3, "%s: purging ifma %p", __func__, ifma); - if (ifp != NULL) { + if (ifp != NULL && (ifp->if_flags & IFF_DYING) == 0) { CURVNET_SET(ifp->if_vnet); inm_purge(inm); free(inm, M_IPMADDR); Best regards, Kristof From owner-freebsd-net@freebsd.org Thu Jul 23 08:16:51 2020 Return-Path: Delivered-To: freebsd-net@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2F770375F56 for ; Thu, 23 Jul 2020 08:16:51 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.nyi.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 4BC4tW0ZDGz4Ddy for ; Thu, 23 Jul 2020 08:16:51 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.nyi.freebsd.org (Postfix) id 13946375D5D; Thu, 23 Jul 2020 08:16:51 +0000 (UTC) Delivered-To: net@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 135C8375EC4 for ; Thu, 23 Jul 2020 08:16:51 +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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BC4tV6pX0z4Dsg for ; Thu, 23 Jul 2020 08:16:50 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) 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 CE6F115D3A for ; Thu, 23 Jul 2020 08:16:50 +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 06N8GooI057842 for ; Thu, 23 Jul 2020 08:16:50 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 06N8Go52057841 for net@FreeBSD.org; Thu, 23 Jul 2020 08:16:50 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 248172] if_tuntap(4): OpenVPN configuring tun/tap devices ends up with IFDISABLED interfaces Date: Thu, 23 Jul 2020 08:16:50 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 12.1-RELEASE X-Bugzilla-Keywords: needs-qa, regression X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: gert@greenie.muc.de X-Bugzilla-Status: Open X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: kevans@freebsd.org X-Bugzilla-Flags: maintainer-feedback? mfc-stable12? 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 MIME-Version: 1.0 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jul 2020 08:16:51 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D248172 --- Comment #11 from Gert Doering --- This is driving me totally insane. The first 4 times I ran the tester, it had IFDISABLED. The next like 50 times, nothing... not sure what else is need to trigger i= t - I ran a few openvpn instances in between ("if it's related to additional configs, like routing changes") but that doesn't trigger it either. --=20 You are receiving this mail because: You are on the CC list for the bug.=