NetBSD Problem Report #48536

From paul@whooppee.com  Mon Jan 20 15:01:49 2014
Return-Path: <paul@whooppee.com>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "Postmaster NetBSD.org" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 4A300A6485
	for <gnats-bugs@gnats.NetBSD.org>; Mon, 20 Jan 2014 15:01:49 +0000 (UTC)
Message-Id: <20140120150147.7B910248472@screamer.whooppee.com>
Date: Mon, 20 Jan 2014 07:01:47 -0800 (PST)
From: paul@whooppee.com
Reply-To: paul@whooppee.com
To: gnats-bugs@NetBSD.org
Subject: Modules need a ref-count mechanism external to the module
X-Send-Pr-Version: 3.95

>Number:         48536
>Category:       kern
>Synopsis:       Modules need a ref-count mechanism external to the module
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    kern-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Jan 20 15:05:00 +0000 2014
>Closed-Date:    Wed Jun 09 03:28:11 +0000 2021
>Last-Modified:  Wed Jun 09 03:28:11 +0000 2021
>Originator:     Paul Goyette
>Release:        NetBSD 6.99.28
>Organization:
-------------------------------------------------------------------------
| Paul Goyette     | PGP Key fingerprint:     | E-mail addresses:       |
| Customer Service | FA29 0E3B 35AF E8AE 6651 | paul at whooppee.com    |
| Network Engineer | 0786 F758 55DE 53BA 7731 | pgoyette at juniper.net |
| Kernel Developer |                          | pgoyette at netbsd.org  |
-------------------------------------------------------------------------
>Environment:


System: NetBSD screamer.whooppee.com 6.99.28 NetBSD 6.99.28 (WHOOPPEE (shared) 2013-12-14 23:34:52) #13: Sat Dec 14 16:05:43 PST 2013 paul@screamer.whooppee.com:/build/netbsd-local/obj/amd64/sys/arch/amd64/compile/WHOOPPEE amd64
Architecture: x86_64
Machine: amd64
>Description:
Device driver modules in particular require a ref-count mechanism to
determine whether or not it is safe for the driver to be unloaded.

Without this mechanism, a driver can be unloaded while the device is still
being accessed from user-land.  Additionally, the driver's detach code
can attempt to release other resources (memory, pools, mutex, etc.) which
are still in use.

See recent discussion on current-users and source-changes-d for more
context.

http://mail-index.netbsd.org/current-users/2014/01/19/msg024107.html
http://mail-index.netbsd.org/source-changes-d/2014/01/19/msg006440.html

>How-To-Repeat:

>Fix:


>Release-Note:

>Audit-Trail:
From: Paul Goyette <paul@whooppee.com>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: kern/48536: Modules need a ref-count mechanism external to the
 module
Date: Fri, 10 Jun 2016 14:32:16 +0800 (PHT)

 Additionally see the following more recent discussion on this topic. 
 Perhaps Taylor's suggesetion could be implemented?

 http://mail-index.netbsd.org/tech-kern/2016/06/07/msg020656.html



 +------------------+--------------------------+------------------------+
 | Paul Goyette     | PGP Key fingerprint:     | E-mail addresses:      |
 | (Retired)        | FA29 0E3B 35AF E8AE 6651 | paul at whooppee.com   |
 | Kernel Developer | 0786 F758 55DE 53BA 7731 | pgoyette at netbsd.org |
 +------------------+--------------------------+------------------------+

State-Changed-From-To: open->closed
State-Changed-By: pgoyette@NetBSD.org
State-Changed-When: Wed, 09 Jun 2021 03:28:11 +0000
State-Changed-Why:
This was fixed a couple years ago with the merge of the new compat code.
That work introduced localcount(9) reference counting for modules.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.46 2020/01/03 16:35:01 leot Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2020 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.