Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 28 Jun 2000 20:10:01 -0700 (PDT)
From:      Bruce Evans <bde@zeta.org.au>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: kern/19553: "panic: zone: entry not free" in namei 
Message-ID:  <200006290310.UAA61484@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/19553; it has been noted by GNATS.

From: Bruce Evans <bde@zeta.org.au>
To: Gregory Bond <gnb@itga.com.au>
Cc: freebsd-gnats-submit@FreeBSD.ORG
Subject: Re: kern/19553: "panic: zone: entry not free" in namei 
Date: Thu, 29 Jun 2000 13:01:33 +1000 (EST)

 On Wed, 28 Jun 2000, Gregory Bond wrote:
 
 > To: David Malone <dwmalone@maths.tcd.ie>
 >  > You often see panics if you compile with INVARIANTS and then load
 >  > modules which have not been compiled with INVARIANTS. Could this
 >  > be the problem?
 >  
 >  Well spotted.
 >  
 >  I was loading cd9660 from a module.  Once I compiled it into the kernel (with
 >  INVARIANTS), the recipe no longer panics but works as expected.
 >  
 >  The trick is that isofs/cd9660/cd9660_vnops.c also uses namei_zone, but when
 >  compiled without INVARIANTS (in the module), the deallocator is not clearing
 >  the "in use" flag that the allocator in the kernel (compiled with INVARIANTS)
 >  is checking at the next allocation, which happens to be inside namei().
 >  
 >  nfs.ko and union.ko also use namei_zone and would be vulnerable to the same
 >  problem.
 >  
 >  Perhaps a note in LINT next to the INVARIANTS entry explaining this? [Patch 
 >  attached]
 
 No, this is a bug in INVARIANTS.  It is caused by bogus ifdefs on
 INVARIANTS in vm_zone.h.  All ifdefs on kernel options in header
 files are wrong, but these ifdefs are wronger than others since
 INVARIANTS is supposed to be settable for single source files.
 
 The correct fix seems to be to clear the "in use" flag unconditionally,
 although this will bloat the zone allocator a little.
 
 INVARIANTS support in vm_zone.c is also broken.  Some things conditional
 on INVARIANTS need to be conditional on INVARIANT_SUPPORT in case
 vm_zone.c is not one of the source files compiled with INVARIANTS
 configured.
 
 Bruce
 
 


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200006290310.UAA61484>