NetBSD Problem Report #323

From gnats  Tue Jul  5 14:35:10 1994
Received: from ki1.chemie.fu-berlin.de (ki1.chemie.fu-berlin.de [130.133.2.21]) by sun-lamp.cs.berkeley.edu (8.6.9/8.6.9) with SMTP id OAA05424 for <gnats-bugs@sun-lamp.cs.berkeley.edu>; Tue, 5 Jul 1994 14:35:05 -0700
Message-Id: <199407051431.AA02582@f40.hanse.de>
Date: Tue, 5 Jul 1994 16:31:31 +0200
From: tik@f40.Hanse.DE
Reply-To: tik@abqhh.Hanse.DE
To: gnats-bugs@sun-lamp.cs.berkeley.edu
Subject: panic on long filenames while doingcache=0
X-Send-Pr-Version: 3.2

>Number:         323
>Category:       kern
>Synopsis:       panic on long filenames while doingcache=0
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    gnats-admin
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Jul 05 14:50:03 +0000 1994
>Closed-Date:    Tue Jul 05 22:01:42 +0000 1994
>Last-Modified:  
>Originator:     Michael Havemester
>Release:        NetBSD 0.9C, -current
>Organization:
>Environment:

System: NetBSD f40.Hanse.DE 0.9C NetBSD 0.9C (F40)

>Description:
	cache_enter panics on long filenames (32 chars and more)
	doingcache=0, DIAGNOSTIC turned on

	cache_enter() (sys/kern/vfs_cache.c) will be called from
        ufs_lookup() (sys/ufs/ufs/ufs_lookup.c), only if
	cnp->cn_flags & MAKEENTRY is true, after a call to cache_lookup().
        MAKEENTRY (from cnp->cn_flags) will be reset inside cache_lookup()
        (sys/kern/vfs_cache.c), if cnp->nc_namelen > NCHNAMLEN, but only
	if doingcache != 0

>How-To-Repeat:
	enable options DIAGNOSTIC in config-File and set
	doingcache to 0 in sys/kern/vfs_cache.c

>Fix:
	test !doingcache in cache_enter() (sys/kern/vfs_cache.c) before
	anything else or modify cache_lookup() (sys/kern/vfs_cache.c) to
	test if cnp->nc_namelen > NCHNAMLEN before testing !doingcache.


*** old/vfs_cache.c	Sun Jul  3 13:05:16 1994
--- vfs_cache.c	Tue Jul  5 15:46:36 1994
***************
*** 195,206 ****
  {
  	register struct namecache *ncp, *ncq, **ncpp;

  #ifdef DIAGNOSTIC
  	if (cnp->cn_namelen > NCHNAMLEN)
  		panic("cache_enter: name too long");
  #endif
- 	if (!doingcache)
- 		return;
  	/*
  	 * Free the cache slot at head of lru chain.
  	 */
--- 195,206 ----
  {
  	register struct namecache *ncp, *ncq, **ncpp;

+ 	if (!doingcache)
+ 		return;
  #ifdef DIAGNOSTIC
  	if (cnp->cn_namelen > NCHNAMLEN)
  		panic("cache_enter: name too long");
  #endif
  	/*
  	 * Free the cache slot at head of lru chain.
  	 */
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: cgd 
State-Changed-When: Tue Jul 5 15:01:42 PDT 1994 
State-Changed-Why:  
fixed several hours ago.  also, provided fix was not correct, 
as it led to a possible race condition. 
>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.