NetBSD Problem Report #38801

From martin@duskware.de  Fri May 30 16:42:20 2008
Return-Path: <martin@duskware.de>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by narn.NetBSD.org (Postfix) with ESMTP id CD47E63B8BC
	for <gnats-bugs@gnats.netbsd.org>; Fri, 30 May 2008 16:42:19 +0000 (UTC)
Message-Id: <20080530164044.C608663B8BC@narn.NetBSD.org>
Date: Fri, 30 May 2008 16:40:44 +0000 (UTC)
From: ad@netbsd.org
Reply-To: ad@netbsd.org
To: netbsd-bugs-owner@NetBSD.org
Subject: most drivers assume seralized d_open/d_close
X-Send-Pr-Version: www-1.0

>Number:         38801
>Category:       kern
>Synopsis:       most drivers assume seralized d_open/d_close
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri May 30 16:45:00 +0000 2008
>Originator:     Andrew Doran
>Release:        4.99.63
>Organization:
The NetBSD Project
>Environment:
n/a
>Description:
Most drivers assume the following but it's not true:

- calls to open() will not overlap
- open() and close() will not overlap

Solaris prevents it, and older versions of NetBSD prevented it. At some 
point a hack was added for tty devices that released the vnode lock while 
a device was being opened/closed, as ttys are known to sleep long-term in 
their open/close routines.

>How-To-Repeat:
Code inspection.
>Fix:
Serialize all open/close activity. To be complete it would need to be
done by major number as we have no way of decoding the minor.

Ensure that any long-term waits in d_open/d_close are interruptible.

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2014 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.