NetBSD Problem Report #44285

From yamt@NetBSD.org  Tue Dec 28 01:37:08 2010
Return-Path: <yamt@NetBSD.org>
Received: by www.NetBSD.org (Postfix, from userid 1270)
	id 74DD763B89A; Tue, 28 Dec 2010 01:37:08 +0000 (UTC)
Message-Id: <20101228013708.74DD763B89A@www.NetBSD.org>
Date: Tue, 28 Dec 2010 01:37:08 +0000 (UTC)
From: yamt@NetBSD.org
Reply-To: yamt@NetBSD.org
To: gnats-bugs@NetBSD.org
Subject: tmpfs rename leaks directory
X-Send-Pr-Version: 3.95

>Number:         44285
>Category:       kern
>Synopsis:       tmpfs rename leaks directory
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    rmind
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Dec 28 01:40:00 +0000 2010
>Closed-Date:    Sun May 29 22:40:08 +0000 2011
>Last-Modified:  Sun May 29 22:40:08 +0000 2011
>Originator:     YAMAMOTO Takashi
>Release:        NetBSD current
>Organization:

>Environment:
>Description:
	tmpfs_rename() leaks the directory overwritten by the rename.
>How-To-Repeat:
	run /usr/tests/fs/vfs/t_renamerace and find ENOSPC.
>Fix:
	decrement the link count as tmpfs_rmdir does.

>Release-Note:

>Audit-Trail:
From: "Mindaugas Rasiukevicius" <rmind@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/44285 CVS commit: src/sys/fs/tmpfs
Date: Sun, 29 May 2011 22:29:08 +0000

 Module Name:	src
 Committed By:	rmind
 Date:		Sun May 29 22:29:07 UTC 2011

 Modified Files:
 	src/sys/fs/tmpfs: tmpfs.h tmpfs_subr.c tmpfs_vfsops.c tmpfs_vnops.c

 Log Message:
 - Rework and document inode reference counting.  Also document inode life
   cycle (destruction part).  Perform link counting in tmpfs_dir_attach()
   and tmpfs_dir_detach(), instead of alloc/free and arbitrary places.
   Fixes PR/44285, PR/44288, PR/44657 and likely PR/42484.

 - Fix the race between the lookup and inode destruction.  Fixes PR/43167
   and its duplicates PR/40088, PR/40757.

 - Improve tmpfs_rename() locking a little, fix kqueue event notifications
   and also fix PR/43617.  Add simplistic tmpfs_parentcheck_p(); to be
   expanded and used for further rename() locking fixes.

 - Cache directory entry "hint" in the tmpfs node, add tmpfs_dir_cached(),
   and thus avoid unnecessary lookup in tmpfs_remove() and tmpfs_rmdir().

 - Set correct _PC_FILESIZEBITS value in tmpfs_pathconf().  Fixes PR/43576.

 - Few minor fixes.


 To generate a diff of this commit:
 cvs rdiff -u -r1.43 -r1.44 src/sys/fs/tmpfs/tmpfs.h
 cvs rdiff -u -r1.70 -r1.71 src/sys/fs/tmpfs/tmpfs_subr.c
 cvs rdiff -u -r1.50 -r1.51 src/sys/fs/tmpfs/tmpfs_vfsops.c
 cvs rdiff -u -r1.84 -r1.85 src/sys/fs/tmpfs/tmpfs_vnops.c

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

Responsible-Changed-From-To: kern-bug-people->rmind
Responsible-Changed-By: rmind@NetBSD.org
Responsible-Changed-When: Sun, 29 May 2011 22:40:08 +0000
Responsible-Changed-Why:


State-Changed-From-To: open->closed
State-Changed-By: rmind@NetBSD.org
State-Changed-When: Sun, 29 May 2011 22:40:08 +0000
State-Changed-Why:
Fixed, thanks.


>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.