NetBSD Problem Report #38188

From martin@duskware.de  Thu Mar  6 21:37:10 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 745EF63B88C
	for <gnats-bugs@gnats.netbsd.org>; Thu,  6 Mar 2008 21:37:10 +0000 (UTC)
Message-Id: <20080306213512.65EA163B88C@narn.NetBSD.org>
Date: Thu,  6 Mar 2008 21:35:12 +0000 (UTC)
From: pooka@iki.fi
Reply-To: pooka@iki.fi
To: netbsd-bugs-owner@NetBSD.org
Subject: handling of pathbufs in componentname is slightly suboptimal
X-Send-Pr-Version: www-1.0

>Number:         38188
>Category:       kern
>Synopsis:       handling of pathbufs in componentname is slightly suboptimal
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    dholland
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Mar 06 21:40:00 +0000 2008
>Closed-Date:    Tue Nov 30 15:57:56 +0000 2010
>Last-Modified:  Tue Nov 30 18:50:38 +0000 2010
>Originator:     Antti Kantee
>Release:        
>Organization:
>Environment:
>Description:
A pathbuf can be saved by a file system for further use by setting
SAVENAME in VOP_LOOKUP().  Regardless of this, struct componentname
is passed to e.g. the remove operation.  ufs does not use the pathbuf
in there, since it caches the correct directory offset in the directory
inode during lookup.  Other file systems might copypaste the ufs
lookup logic but neglect to set SAVENAME for DELETE even if using the
pathbuffer.  E.g. puffs has always been broken this way and tmpfs
was broken recently.  Luckily (or, actually, unluckily?), the
pathbuf is a pool_cache and likely to be intact even if freed.
>How-To-Repeat:
instead of doing fun stuff, read file system code
>Fix:
quick fix: Go over file systems (yippee) and fix violators.
Since componentname has a flag HASBUF, actually use that and
sprinkle KASSERTs everywhere.

real fix: buy lots of sushi to a certain developer and cross fingers.

>Release-Note:

>Audit-Trail:
From: Antti Kantee <pooka@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/38188 CVS commit: src/sys/fs/puffs
Date: Sat, 19 Sep 2009 11:44:19 +0000

 Module Name:	src
 Committed By:	pooka
 Date:		Sat Sep 19 11:44:19 UTC 2009

 Modified Files:
 	src/sys/fs/puffs: puffs_vnops.c

 Log Message:
 Set SAVENAME for rmdir and remove.

 Addresses an easy part of PR kern/38188


 To generate a diff of this commit:
 cvs rdiff -u -r1.132 -r1.133 src/sys/fs/puffs/puffs_vnops.c

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

From: Soren Jacobsen <snj@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/38188 CVS commit: [netbsd-5] src/sys/fs/puffs
Date: Sat, 26 Sep 2009 18:53:48 +0000

 Module Name:	src
 Committed By:	snj
 Date:		Sat Sep 26 18:53:48 UTC 2009

 Modified Files:
 	src/sys/fs/puffs [netbsd-5]: puffs_vnops.c

 Log Message:
 Pull up following revision(s) (requested by pooka in ticket #1014):
 	sys/fs/puffs/puffs_vnops.c: revision 1.133
 Set SAVENAME for rmdir and remove.
 Addresses an easy part of PR kern/38188


 To generate a diff of this commit:
 cvs rdiff -u -r1.129 -r1.129.4.1 src/sys/fs/puffs/puffs_vnops.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: Tue, 30 Nov 2010 17:57:56 +0200
State-Changed-Why:
SAVENAME/HASBUG is dead


Responsible-Changed-From-To: kern-bug-people->dholland
Responsible-Changed-By: dholland@NetBSD.org
Responsible-Changed-When: Tue, 30 Nov 2010 18:50:10 +0000
Responsible-Changed-Why:
I fixed it (and I should have remembered to close this)


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