From jehamby@hamby1.lightside.net  Thu Nov 28 23:53:34 1996
Received: from hamby1.lightside.net (hamby1.lightside.net [207.67.176.17])
          by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id XAA04939
          for <FreeBSD-gnats-submit@freebsd.org>; Thu, 28 Nov 1996 23:53:32 -0800 (PST)
Received: (from jehamby@localhost) by hamby1.lightside.net (8.8.3/8.8.2) id XAA00377; Thu, 28 Nov 1996 23:53:12 -0800 (PST)
Message-Id: <199611290753.XAA00377@hamby1.lightside.net>
Date: Thu, 28 Nov 1996 23:53:12 -0800 (PST)
From: jehamby@lightside.com
Reply-To: jehamby@lightside.com
To: FreeBSD-gnats-submit@freebsd.org
Subject: MAXBSIZE in param.h causes kernel panic if MSDOSFS LKM loaded
X-Send-Pr-Version: 3.2

>Number:         2121
>Category:       kern
>Synopsis:       MAXBSIZE in param.h causes kernel panic if MSDOSFS LKM loaded
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Nov 29 00:00:04 PST 1996
>Closed-Date:    Mon Apr 20 14:25:00 PDT 1998
>Last-Modified:  Mon Apr 20 14:29:28 PDT 1998
>Originator:     Jake Hamby
>Release:        FreeBSD 3.0-CURRENT i386
>Organization:
Jet Propulsion Laboratory
>Environment:

3.0-CURRENT cvsupped on 96/11/28 without MSDOSFS defined in the kernel
config, but with the msdos LKM loaded at boot.

>Description:

sys/param.h was recently changed to define MAXBSIZE as 32768 if MSDOSFS is
defined, or 16384 otherwise.  If MSDOSFS is not compiled into the kernel,
but instead loaded as an LKM (as I have done), then the kernel immediately
panics with: "panic: getblk: size(32768) > MAXBSIZE(16384)" when the LKM
is loaded.

>How-To-Repeat:

Build a kernel without MSDOSFS.  Boot with it, then attempt to mount an
MSDOS filesystem or manually load the msdos LKM.

>Fix:
	
Because we have no idea if the user is going to load the msdos LKM, the
only sensible patch is to always define MAXBSIZE as 32768, and I
recommend that this be done immediately.  Perhaps a comment could be
added to param.h for expert users, stating that they can decrease this
manually, but at their own risk, and only if they NEVER plan to use the DOS
filesystem, even as an LKM.
>Release-Note:
>Audit-Trail:

From: "John S. Dyson" <toor@dyson.iquest.net>
To: jehamby@lightside.com
Cc: FreeBSD-gnats-submit@freebsd.org
Subject: Re: kern/2121: MAXBSIZE in param.h causes kernel panic if MSDOSFS LKM loaded
Date: Fri, 29 Nov 1996 03:19:44 -0500 (EST)

 > 
 > sys/param.h was recently changed to define MAXBSIZE as 32768 if MSDOSFS is
 > defined, or 16384 otherwise.  If MSDOSFS is not compiled into the kernel,
 > but instead loaded as an LKM (as I have done), then the kernel immediately
 > panics with: "panic: getblk: size(32768) > MAXBSIZE(16384)" when the LKM
 > is loaded.
 > 
 Good, it caught a possible system corruption.
 
 > 
 > Because we have no idea if the user is going to load the msdos LKM, the
 > only sensible patch is to always define MAXBSIZE as 32768, and I
 > recommend that this be done immediately.
 >
 Might be a bad idea because it takes lots of kernel virtual space
 on bigger machines. 
 
 >
 >  Perhaps a comment could be
 > added to param.h for expert users, stating that they can decrease this
 > manually, but at their own risk, and only if they NEVER plan to use the DOS
 > filesystem, even as an LKM.
 > 
 Or perhaps panic the system when we run out of KVA space on a critical
 server system? :-).
 
 The problem is still being reviewed and visited, and consider your
 input as registered.  The biggest problem that I have is that the
 "fix" of increasing MAXBSIZE to 32K isn't good enough, and we will
 have to increase it again to 64K...  That is more evil for larger
 machines (which are going to become more and more common.)
 
 John
 

From: Jason Thorpe <thorpej@nas.nasa.gov>
To: jehamby@lightside.com
Cc: FreeBSD-gnats-submit@freebsd.org
Subject: Re: kern/2121: MAXBSIZE in param.h causes kernel panic if MSDOSFS LKM loaded 
Date: Fri, 29 Nov 1996 00:37:26 -0800

 On Thu, 28 Nov 1996 23:53:12 -0800 (PST) 
  jehamby@lightside.com wrote:
 
  > sys/param.h was recently changed to define MAXBSIZE as 32768 if MSDOSFS is
  > defined, or 16384 otherwise.  If MSDOSFS is not compiled into the kernel,
  > but instead loaded as an LKM (as I have done), then the kernel immediately
  > panics with: "panic: getblk: size(32768) > MAXBSIZE(16384)" when the LKM
  > is loaded.
 
 MAXBSIZE should probably just expand to MAXPHYS.  It seems seriously
 wrong to conditionalize it on some random config option.
 
 Jason R. Thorpe                                       thorpej@nas.nasa.gov
 NASA Ames Research Center                               Home: 408.866.1912
 NAS: M/S 258-6                                          Work: 415.604.0935
 Moffett Field, CA 94035                                Pager: 415.428.6939

From: Martin Cracauer <cracauer@cons.org>
To: freebsd-gnats-submit@freebsd.org
Cc: cracauer@cons.org
Subject: Re: kern/2121: MAXBSIZE in param.h causes kernel panic if MSDOSFS LKM loaded
Date: Fri, 06 Feb 1998 15:04:03 +0100

 Why not refuse to load the LKM when the running kernel is
 compiled with too small MAXBSIZE? With meaningful error message,
 of course.
 
 Martin
 -- 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 Martin Cracauer <cracauer@bik-gmbh.de> http://www.bik-gmbh.de/~cracauer
 BIK - Aschpurwis + Behrens GmbH, Hamburg/Germany
 Tel.: +49 40 414787 -12, Fax. +49 40 414787 -15
State-Changed-From-To: open->closed 
State-Changed-By: rnordier 
State-Changed-When: Mon Apr 20 14:25:00 PDT 1998 
State-Changed-Why:  
This PR relates to a brief period when MAXBSIZE was conditionally 
defined as 16384 or 32768, depending on whether MSDOSFS was compiled 
into the kernel.  This no longer pertains. 
>Unformatted:
