From nobody Fri Sep 22 05:46:58 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 4RsLr213Xfz4vYqC for ; Fri, 22 Sep 2023 05:46:58 +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 4RsLr1741Mz4Hlx for ; Fri, 22 Sep 2023 05:46:57 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1695361618; a=rsa-sha256; cv=none; b=lcQTjx1IXPN6xbG0J3xT018Jie1QXifu7ltIpM9iLgRPZJLhFv8fb7uVSGcOguUnasnR40 wPKFo5bp0ooJBQrTyIE13jlDNESLTVhJkU3/zt3ushKhDHZEBzifNusnymmj0hyuJ19J6g JZFcTZF4T9zBDw5j/OnkAxn4vTiHkO44GIxrgSZ7XSkuD/EEJ7vqsVHYf5pTPm0f1aP7Ut QvCXEjWBPOImCEWDKymHdS0XCNTebQyGdo9mS8cJ3RwMRnpgZSa7q3Tt/JhwPddfFKHlWT 1RpHZCrVLAyy5ifF9RfUKSAZ6BG3sHtNORs3uVX7k+TsHGsWXJRzn6Wb1McU+w== 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=1695361618; 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=ab2mU7rwYkTu8ZnvQfMu9Y/30U7JKyCEWTTS5bX4a8Q=; b=YJcIaDhd557Sp0mWhQ72Xo3eft1XiQgqeAh6NDnICjsA+NUMn6rdt/z/lauwSiyEazYV5Z ijUsueEaZ1oR2GR4MUaSDdqvA7tZ57z6AXkoAaBfRGhJXZg3nukgu1gXyqq9fzA/lrtDtp UnSN4cZeQtdpvvaqPGJ1i+/01MsnJkRIyvPGUFrFfdZepnM48Dj1y4NEF5OqU+UAC1mLby 5Us+halVW3dTAsQ2PC76vxzHFi6JV+/LkyqganU3b7cu+6jlfdgiL/y3XTNPwF434R8Bou boP4uRViHlEkhO+d8fIRXXi2NjSk/+IOoUneHOqUp1l5Ggjva0eCUCij0lwfyw== 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 4RsLr167n1z18SG for ; Fri, 22 Sep 2023 05:46:57 +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 38M5kvNp034163 for ; Fri, 22 Sep 2023 05:46:57 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 38M5kvL8034162 for bugs@FreeBSD.org; Fri, 22 Sep 2023 05:46:57 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 05:46:58 +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 #40 from Konstantin Belousov --- commit 508e5f7d8d852b0f24cf0200d4486997d5d09409 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..756aa04482cb 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.=