Date: Thu, 23 Jul 2020 10:09:25 +0200 From: "Kristof Provost" <kp@FreeBSD.org> To: "John-Mark Gurney" <jmg@funkthat.com> Cc: "Bjoern A. Zeeb" <bzeeb-lists@lists.zabbadoz.net>, freebsd-net@freebsd.org, freebsd-current@freebsd.org Subject: Re: somewhat reproducable vimage panic 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>
index | next in thread | previous in thread | raw e-mail
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: <owner-freebsd-net@freebsd.org>
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 <freebsd-net@mailman.nyi.freebsd.org>;
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 <freebsd-net@freebsd.org>; 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 <net@mailman.nyi.freebsd.org>; 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 <net@FreeBSD.org>; 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 <net@FreeBSD.org>; 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 <net@FreeBSD.org>; 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: <bug-248172-7501-i4Cy1NvDyi@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-248172-7501@https.bugs.freebsd.org/bugzilla/>
References: <bug-248172-7501@https.bugs.freebsd.org/bugzilla/>
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 <freebsd-net.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/freebsd-net>,
<mailto:freebsd-net-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/freebsd-net/>
List-Post: <mailto:freebsd-net@freebsd.org>
List-Help: <mailto:freebsd-net-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/freebsd-net>,
<mailto:freebsd-net-request@freebsd.org?subject=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 <gert@greenie.muc.de> ---
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.=
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6847FB6B-0B1A-43C7-B567-15BF21AB5D56>
