Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 18 Sep 2023 21:29:04 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 273418] [panic] Repeating kernel panic on open(/dev/console)
Message-ID:  <bug-273418-227-uB8HTgP2qR@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-273418-227@https.bugs.freebsd.org/bugzilla/>
References:  <bug-273418-227@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D273418

--- Comment #15 from Konstantin Belousov <kib@FreeBSD.org> ---
No, checking at list addition or removal is to late.
Problem is clearly that device is dereferenced while active, i.e. it sounds
as if somebody did dev_rel() manually.

So IMO the following assert is due, and it is indeed should be added to
the tree:

diff --git a/sys/fs/devfs/devfs_devs.c b/sys/fs/devfs/devfs_devs.c
index c6efd0d421b1..f91e6e29b35d 100644
--- a/sys/fs/devfs/devfs_devs.c
+++ b/sys/fs/devfs/devfs_devs.c
@@ -175,6 +175,8 @@ devfs_free(struct cdev *cdev)
        struct cdev_priv *cdp;

        cdp =3D cdev2priv(cdev);
+       KASSERT((cdp->cdp_flags & CDP_ACTIVE) =3D=3D 0,
+           ("cdev %p %s active and freed", cdp, cdev->si_name));
        if (cdev->si_cred !=3D NULL)
                crfree(cdev->si_cred);
        devfs_free_cdp_inode(cdp->cdp_inode);

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-273418-227-uB8HTgP2qR>