NetBSD Problem Report #43694

From www@NetBSD.org  Mon Aug  2 10:20:36 2010
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by www.NetBSD.org (Postfix) with ESMTP id 4813463BB83
	for <gnats-bugs@gnats.NetBSD.org>; Mon,  2 Aug 2010 10:20:36 +0000 (UTC)
Message-Id: <20100802102035.E23A063BB79@www.NetBSD.org>
Date: Mon,  2 Aug 2010 10:20:35 +0000 (UTC)
From: pooka@iki.fi
Reply-To: pooka@iki.fi
To: gnats-bugs@NetBSD.org
Subject: fd_getfile / fd_alloc race
X-Send-Pr-Version: www-1.0

>Number:         43694
>Category:       kern
>Synopsis:       fd_getfile / fd_alloc race
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Aug 02 10:25:00 +0000 2010
>Closed-Date:    Wed Aug 04 14:27:33 +0000 2010
>Last-Modified:  Wed Aug 04 14:30:03 +0000 2010
>Originator:     Antti Kantee
>Release:        
>Organization:
>Environment:
>Description:
fd_getfile() ups the fdfile's refcnt, checks for ff_file and if NULL
lowers the refcnt and returns fail.  Meanwhile, fd_alloc selects
a free file descriptor and KASSERTs that the refcount is 0.
>How-To-Repeat:
run tests/kernel/t_filedesc -v iters=10000000 getfilerace
>Fix:
Maybe the kassert is wrong.  But I didn't fully think through how
application threads need to synchronize fd usage to be race-free.

>Release-Note:

>Audit-Trail:
From: Antti Kantee <pooka@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/43694 CVS commit: src/tests/kernel
Date: Mon, 2 Aug 2010 10:29:48 +0000

 Module Name:	src
 Committed By:	pooka
 Date:		Mon Aug  2 10:29:48 UTC 2010

 Modified Files:
 	src/tests/kernel: Makefile
 Added Files:
 	src/tests/kernel: t_filedesc.c

 Log Message:
 test case for PR kern/43694


 To generate a diff of this commit:
 cvs rdiff -u -r1.7 -r1.8 src/tests/kernel/Makefile
 cvs rdiff -u -r0 -r1.1 src/tests/kernel/t_filedesc.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->closed
State-Changed-By: pooka@NetBSD.org
State-Changed-When: Wed, 04 Aug 2010 17:27:33 +0300
State-Changed-Why:
fixed


From: Antti Kantee <pooka@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/43694 CVS commit: src/sys/kern
Date: Wed, 4 Aug 2010 14:25:16 +0000

 Module Name:	src
 Committed By:	pooka
 Date:		Wed Aug  4 14:25:16 UTC 2010

 Modified Files:
 	src/sys/kern: kern_descrip.c

 Log Message:
 Remove overzealous KASSERT: the refcount can be non-zero if another
 thread attempts to use a non-open file descriptor.  from ad

 fixes PR kern/43694


 To generate a diff of this commit:
 cvs rdiff -u -r1.203 -r1.204 src/sys/kern/kern_descrip.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

>Unformatted:

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-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.