Subject: kern/20934: macppc & MAXBSIZE < 64k & 2KB sector size devices == boom
To: None <>
From: None <>
List: netbsd-bugs
Date: 03/30/2003 02:27:21
>Number:         20934
>Category:       kern
>Synopsis:       macppc & MAXBSIZE < 64k & 2KB sector size devices == boom
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Mar 29 08:28:01 PST 2003
>Originator:     matthew green
>Release:        NetBSD 1.6P
people's front against (bozotic) www (softwar foundation)
System: NetBSD 1.6P NetBSD 1.6P (_splode_) #30: Sat Mar 15 00:15:28 EST 2003 sparc64
Architecture: sparc
Machine: sparc64

	on a powermac G4 with a new dvdrom drive, i get panics in my kernel
	if i set MAXBSIZE less than 64KB.  i tracked this to macppc/disksubr.c
	read_mac_label() calling geteblk() with sectorsize * 32, which with
	the old 512 byte cdrw is 16KB, but with the new dvdrom it causes
	allocbuf() to panic: allocbuf: buffer larger than MAXBSIZE requested.
	this line is the culprit:

		bp = geteblk((int)lp->d_secsize * NUM_PARTS);


	try to use a 2KB sector size device on a 16KB MAXBSIZE macppc machine.


	rework mac_read_label() to keep buffers MAXBSIZE or smaller!