From owner-freebsd-net@freebsd.org Fri Jul 17 16:56:46 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 9E54A36980E for ; Fri, 17 Jul 2020 16:56:46 +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 4B7cjB3nkpz4HPr for ; Fri, 17 Jul 2020 16:56:46 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.nyi.freebsd.org (Postfix) id 803E43697B8; Fri, 17 Jul 2020 16:56:46 +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 8003136916B for ; Fri, 17 Jul 2020 16:56:46 +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 4B7cjB2sWKz4HD3 for ; Fri, 17 Jul 2020 16:56:46 +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 417B41C887 for ; Fri, 17 Jul 2020 16:56:46 +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 06HGukJB092455 for ; Fri, 17 Jul 2020 16:56:46 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 06HGuksK092454 for net@FreeBSD.org; Fri, 17 Jul 2020 16:56:46 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 248046] Panic when creating a bridge interface Date: Fri, 17 Jul 2020 16:56:46 +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: 12.1-STABLE X-Bugzilla-Keywords: panic X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: kp@freebsd.org X-Bugzilla-Status: New 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 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: Fri, 17 Jul 2020 16:56:46 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D248046 --- Comment #1 from Kristof Provost --- That seems fairly straightforward. The only odd thing is that this doesn't trigger panics on current. It looks like epoch is a bit more tolerant of sleeps there. Still, it looks to be easy to avoid the malloc(M_WAITOK), so let's just do = that everywhere. I'm testing this patch now: diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c index 19d8d8964d9..51ee9d29906 100644 --- a/sys/net/if_bridge.c +++ b/sys/net/if_bridge.c @@ -1393,9 +1393,9 @@ bridge_ioctl_gifs(struct bridge_softc *sc, void *arg) bifc->ifbic_len =3D buflen; return (0); } - BRIDGE_UNLOCK(sc); - outbuf =3D malloc(buflen, M_TEMP, M_WAITOK | M_ZERO); - BRIDGE_LOCK(sc); + outbuf =3D malloc(buflen, M_TEMP, M_NOWAIT | M_ZERO); + if (outbuf =3D=3D NULL) + return (ENOMEM); count =3D 0; buf =3D outbuf; @@ -1455,9 +1455,9 @@ bridge_ioctl_rts(struct bridge_softc *sc, void *arg) count++; buflen =3D sizeof(bareq) * count; - BRIDGE_UNLOCK(sc); - outbuf =3D malloc(buflen, M_TEMP, M_WAITOK | M_ZERO); - BRIDGE_LOCK(sc); + outbuf =3D malloc(buflen, M_TEMP, M_NOWAIT | M_ZERO); + if (outbuf =3D=3D NULL) + return (ENOMEM); count =3D 0; buf =3D outbuf; @@ -1783,9 +1783,9 @@ bridge_ioctl_gifsstp(struct bridge_softc *sc, void *a= rg) return (0); } - BRIDGE_UNLOCK(sc); - outbuf =3D malloc(buflen, M_TEMP, M_WAITOK | M_ZERO); - BRIDGE_LOCK(sc); + outbuf =3D malloc(buflen, M_TEMP, M_NOWAIT | M_ZERO); + if (outbuf =3D=3D NULL) + return (ENOMEM); count =3D 0; buf =3D outbuf; --=20 You are receiving this mail because: You are the assignee for the bug.=