From nobody Fri Sep 22 04:52:38 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 4RsKdL3dKgz4vWHB for ; Fri, 22 Sep 2023 04:52:38 +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 4RsKdL2dhTz3dCL for ; Fri, 22 Sep 2023 04:52:38 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1695358358; a=rsa-sha256; cv=none; b=vLcK6lnX/GSDcr6xFs0N/AhKI7undrjJLNzxkUN1EDPj2EggjIhJxnDOLN4KeFjui/NnL6 nFD+F/zu2+kza7iEeIzv1tBp3ZJ7+F3hVac2s2pRwwMeFqc3+BNIm2A9IZwleB7kfGIqHS CnIH7z6+caMcCmTMz/1/maUT57E0dMFpSrTUXd+AC0EnnZN1Mo60vaCtQ3focvdaUckJw8 xm27YDpFapNoDNKo089iSPNCp/WGt0ZsdZrnmdhBcXimNgg272Dp64S5toA1CZF4bj6m23 xcHWUA6sGW1xnA/EARZMkEAbunN3x6flU5MQziMJy6E3GJ/nXIDeT42Ko1wVyw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1695358358; 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=UcWZ3NXpPXe2tfsgRohv4rEKINeYcsnh7gMGjxq3PO8=; b=cxExD4ywnLfzO37QGAysy+1wg1NTgW4MYVETLEsZiMEGnMdSYppOXpP4hz76q2fNy1VoLi d5Uxn9uXIWfnyaTb/YShVQVZP2+wmnFZ08FCTh1yTtYua8KHrnaPG+f5TYZEKBEkoE6B8s LkBd+1fPJSmqY6BABy8OU5IWQdgLpzfwYPUaxYHUlwzc3BbDvEYsHmTVoctjQrW66V0aZT IFh8FKMZR+js3IZjW7g2rajseBOzO49BP3kPew1XaEXpZCVpX/pzL5GXkgrwVm2Y4+7aaS ezWXrNLJ6hq8Y4c4gRINX4alkaxo2uGtKEQJUiBFQ3DKfo7q/Bl0P2357YnZ9A== 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 4RsKdL1kS8z17Rr for ; Fri, 22 Sep 2023 04:52:38 +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 38M4qc2n057225 for ; Fri, 22 Sep 2023 04:52:38 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 38M4qcPf057224 for bugs@FreeBSD.org; Fri, 22 Sep 2023 04:52:38 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 273418] [panic] Repeating kernel panic on open(/dev/console) Date: Fri, 22 Sep 2023 04:52:38 +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.2-STABLE X-Bugzilla-Keywords: crash, regression X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: kib@FreeBSD.org X-Bugzilla-Status: New 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 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D273418 --- Comment #38 from Konstantin Belousov --- Or better, this one. Previous patch would leak refcount on non-cloned cdev= s. commit 0da5656dd70cd5a41c7fb3f4f1c5b8d7f72b9801 Author: Konstantin Belousov Date: Thu Sep 21 13:47:14 2023 +0300 tun/tap: correct ref count on cloned cdevs PR: 273418 (cherry picked from commit 07fda41d2a2df0d0d422f30a8a2353de5f0d9c3e) diff --git a/sys/net/if_tuntap.c b/sys/net/if_tuntap.c index b81c2149a62f..723749c0dca9 100644 --- a/sys/net/if_tuntap.c +++ b/sys/net/if_tuntap.c @@ -541,6 +541,8 @@ tun_clone_create(struct if_clone *ifc, char *name, size= _t len, caddr_t params) /* find any existing device, or allocate new unit number */ dev =3D NULL; i =3D clone_create(&drv->clones, &drv->cdevsw, &unit, &dev, 0); + if (i =3D=3D 0) + dev_ref(dev); /* No preexisting struct cdev *, create one */ if (i !=3D 0) i =3D tun_create_device(drv, unit, NULL, &dev, name); @@ -596,6 +598,8 @@ tunclone(void *arg, struct ucred *cred, char *name, int namelen, /* find any existing device, or allocate new unit number */ i =3D clone_create(&drv->clones, &drv->cdevsw, &u, dev, 0); + if (i =3D=3D 0) { + dev_ref(*dev); if (i) { if (append_unit) { namelen =3D snprintf(devname, sizeof(devname), "%s%= d", --=20 You are receiving this mail because: You are the assignee for the bug.=