summaryrefslogtreecommitdiffstats
path: root/sys/i386/isa/if_ed.c
diff options
context:
space:
mode:
authordg <dg@FreeBSD.org>1997-09-08 20:00:21 +0000
committerdg <dg@FreeBSD.org>1997-09-08 20:00:21 +0000
commit224a34b929fc7c1be0a3e54137664b59ca1ee7b9 (patch)
tree7e6417498f38cb6dcdfda3cbdcbddd18b29ccbb7 /sys/i386/isa/if_ed.c
parent10251b0fa8fa706847530170ddb8e32845ebd44d (diff)
downloadFreeBSD-src-224a34b929fc7c1be0a3e54137664b59ca1ee7b9.zip
FreeBSD-src-224a34b929fc7c1be0a3e54137664b59ca1ee7b9.tar.gz
Added a check for the ISA memory address range being valid. Fixes PR#835.
Diffstat (limited to 'sys/i386/isa/if_ed.c')
-rw-r--r--sys/i386/isa/if_ed.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/sys/i386/isa/if_ed.c b/sys/i386/isa/if_ed.c
index a241359..3649ba8 100644
--- a/sys/i386/isa/if_ed.c
+++ b/sys/i386/isa/if_ed.c
@@ -24,7 +24,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: if_ed.c,v 1.118 1997/09/02 01:18:07 bde Exp $
+ * $Id: if_ed.c,v 1.119 1997/09/08 10:27:09 davidg Exp $
*/
/*
@@ -451,7 +451,7 @@ ed_probe_WD80x3(isa_dev)
{
struct ed_softc *sc = &ed_softc[isa_dev->id_unit];
int i;
- u_int memsize;
+ u_int memsize, maddr;
u_char iptr, isa16bit, sum;
sc->asic_addr = isa_dev->id_iobase;
@@ -629,6 +629,13 @@ ed_probe_WD80x3(isa_dev)
if (isa_dev->id_msize)
memsize = isa_dev->id_msize;
+ maddr = (u_int) isa_dev->id_maddr & 0xffffff;
+ if (maddr < 0xc0000 || maddr + memsize > 0x1000000) {
+ printf("ed%d: Invalid ISA memory address range configured: 0x%x - 0x%x\n",
+ isa_dev->id_unit, maddr, maddr + memsize);
+ return 0;
+ }
+
/*
* (note that if the user specifies both of the following flags that
* '8bit' mode intentionally has precedence)
OpenPOWER on IntegriCloud