Subject: port-i386/4114: bus_space_map should check region bounds
To: None <gnats-bugs@gnats.netbsd.org>
From: Martin Husemann <martin@rumolt.teuto.de>
List: netbsd-bugs
Date: 09/16/1997 10:23:52
>Number:         4114
>Category:       port-i386
>Synopsis:       bus_space_map panics with values outside some bus_space region
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    gnats-admin (GNATS administrator)
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Tue Sep 16 02:05:01 1997
>Last-Modified:
>Originator:     Martin Husemann
>Organization:
UP-Vision Computergrphik GmbH, Bad Arolsen
>Release:        September 03 1997
>Environment:
	
System: NetBSD rumolt.teuto.de 1.2G NetBSD 1.2G (RUMOLT) #1: Thu Aug 28 10:13:28 MEST 1997 root@hwart.teuto.de:/usr/src/sys-local/arch/i386/compile/RUMOLT i386


>Description:

I have a card which maps multiple IO port ranges with fixed base offsets
from the given iobase. One of this offsets is negative, so the resulting
port no might end up negative. I think bus_space_map should silently fail
in this case (a case handled already in the probe/attach code), instead it
causes a panic in the extend manager. This would make driver code easier.

Of course I can (and now do) catch this in the bus specific attach code.

>How-To-Repeat:

Let user specify bad iobase, see above.

>Fix:

>Audit-Trail:
>Unformatted: