summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1998-08-31 17:42:46 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1998-08-31 17:42:46 +0000
commit8de80c67d0f54dc8f36ad93547129197b2447c6a (patch)
tree0556a00de0ab667e7f1eb6af1300e94695c5a968
parent1fb6ebfd016dbeb5944a4247652ad063c1fec0d6 (diff)
Return ENXIO on open of /dev/mem minor devs that don't exist
-rw-r--r--sys/arch/alpha/alpha/mem.c12
-rw-r--r--sys/arch/amiga/amiga/mem.c13
-rw-r--r--sys/arch/hp300/hp300/mem.c12
-rw-r--r--sys/arch/i386/i386/mem.c9
-rw-r--r--sys/arch/kbus/kbus/mem.c11
-rw-r--r--sys/arch/mac68k/mac68k/mem.c12
-rw-r--r--sys/arch/mips/mips/mem.c13
-rw-r--r--sys/arch/mvme68k/mvme68k/mem.c12
-rw-r--r--sys/arch/mvme88k/mvme88k/mem.c10
-rw-r--r--sys/arch/pmax/pmax/mem.c10
-rw-r--r--sys/arch/powerpc/powerpc/mem.c13
-rw-r--r--sys/arch/sparc/sparc/mem.c13
-rw-r--r--sys/arch/sun3/sun3/mem.c20
-rw-r--r--sys/arch/vax/vax/mem.c12
-rw-r--r--sys/arch/wgrisc/wgrisc/mem.c13
15 files changed, 158 insertions, 27 deletions
diff --git a/sys/arch/alpha/alpha/mem.c b/sys/arch/alpha/alpha/mem.c
index b4719ee0c93..8591825be1c 100644
--- a/sys/arch/alpha/alpha/mem.c
+++ b/sys/arch/alpha/alpha/mem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mem.c,v 1.7 1997/06/05 23:21:11 deraadt Exp $ */
+/* $OpenBSD: mem.c,v 1.8 1998/08/31 17:42:25 millert Exp $ */
/* $NetBSD: mem.c,v 1.10 1996/11/13 21:13:10 cgd Exp $ */
/*
@@ -71,7 +71,15 @@ mmopen(dev, flag, mode, p)
struct proc *p;
{
- return (0);
+ switch (minor(dev)) {
+ case 0:
+ case 1:
+ case 2:
+ case 12:
+ return (0);
+ default:
+ return (ENXIO);
+ }
}
/*ARGSUSED*/
diff --git a/sys/arch/amiga/amiga/mem.c b/sys/arch/amiga/amiga/mem.c
index 4fef987b13a..be28dc7c5c6 100644
--- a/sys/arch/amiga/amiga/mem.c
+++ b/sys/arch/amiga/amiga/mem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mem.c,v 1.5 1997/09/09 10:56:17 niklas Exp $ */
+/* $OpenBSD: mem.c,v 1.6 1998/08/31 17:42:27 millert Exp $ */
/* $NetBSD: mem.c,v 1.18 1997/02/02 07:17:14 thorpej Exp $ */
/*
@@ -74,7 +74,16 @@ mmopen(dev, flag, mode, p)
struct proc *p;
{
- return (0);
+ switch (minor(dev)) {
+ case 0:
+ case 1:
+ case 2:
+ case 12:
+ case 20:
+ return (0);
+ default:
+ return (ENXIO);
+ }
}
/*ARGSUSED*/
diff --git a/sys/arch/hp300/hp300/mem.c b/sys/arch/hp300/hp300/mem.c
index a2d2b58b08a..d2d0bb61324 100644
--- a/sys/arch/hp300/hp300/mem.c
+++ b/sys/arch/hp300/hp300/mem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mem.c,v 1.6 1997/07/06 08:02:06 downsj Exp $ */
+/* $OpenBSD: mem.c,v 1.7 1998/08/31 17:42:28 millert Exp $ */
/* $NetBSD: mem.c,v 1.17 1997/06/10 18:51:31 veego Exp $ */
/*
@@ -73,7 +73,15 @@ mmopen(dev, flag, mode)
int flag, mode;
{
- return (0);
+ switch (minor(dev)) {
+ case 0:
+ case 1:
+ case 2:
+ case 12:
+ return (0);
+ default:
+ return (ENXIO);
+ }
}
/*ARGSUSED*/
diff --git a/sys/arch/i386/i386/mem.c b/sys/arch/i386/i386/mem.c
index b6092b717a6..65395b92361 100644
--- a/sys/arch/i386/i386/mem.c
+++ b/sys/arch/i386/i386/mem.c
@@ -1,5 +1,5 @@
/* $NetBSD: mem.c,v 1.31 1996/05/03 19:42:19 christos Exp $ */
-/* $OpenBSD: mem.c,v 1.8 1998/07/09 18:22:13 deraadt Exp $ */
+/* $OpenBSD: mem.c,v 1.9 1998/08/31 17:42:30 millert Exp $ */
/*
* Copyright (c) 1988 University of Utah.
* Copyright (c) 1982, 1986, 1990, 1993
@@ -78,6 +78,11 @@ mmopen(dev, flag, mode, p)
{
switch (minor(dev)) {
+ case 0:
+ case 1:
+ case 2:
+ case 12:
+ break;
#ifdef COMPAT_10
/* This is done by i386_iopl(3) now. */
case 14:
@@ -100,7 +105,7 @@ mmopen(dev, flag, mode, p)
break;
#endif
default:
- break;
+ return (ENXIO);
}
return (0);
}
diff --git a/sys/arch/kbus/kbus/mem.c b/sys/arch/kbus/kbus/mem.c
index 793daea4889..eaf8b44c862 100644
--- a/sys/arch/kbus/kbus/mem.c
+++ b/sys/arch/kbus/kbus/mem.c
@@ -68,7 +68,16 @@ mmopen(dev, flag, mode, p)
struct proc *p;
{
- return (0);
+ switch (minor(dev)) {
+ case 0:
+ case 1:
+ case 2:
+ case 11:
+ case 12:
+ return (0);
+ default:
+ return (ENXIO);
+ }
}
/*ARGSUSED*/
diff --git a/sys/arch/mac68k/mac68k/mem.c b/sys/arch/mac68k/mac68k/mem.c
index f9dd4160bbd..8723e20240a 100644
--- a/sys/arch/mac68k/mac68k/mem.c
+++ b/sys/arch/mac68k/mac68k/mem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mem.c,v 1.4 1997/02/10 12:01:47 downsj Exp $ */
+/* $OpenBSD: mem.c,v 1.5 1998/08/31 17:42:32 millert Exp $ */
/* $NetBSD: mem.c,v 1.11 1996/05/05 06:18:41 briggs Exp $ */
/*
@@ -71,7 +71,15 @@ mmopen(dev, flag, mode, p)
struct proc *p;
{
- return (0);
+ switch (minor(dev)) {
+ case 0:
+ case 1:
+ case 2:
+ case 12:
+ return (0);
+ default:
+ return (ENXIO);
+ }
}
/*ARGSUSED*/
diff --git a/sys/arch/mips/mips/mem.c b/sys/arch/mips/mips/mem.c
index 68b8fa1d6a7..b8172a9ad8c 100644
--- a/sys/arch/mips/mips/mem.c
+++ b/sys/arch/mips/mips/mem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mem.c,v 1.1 1998/01/28 12:12:08 pefo Exp $ */
+/* $OpenBSD: mem.c,v 1.2 1998/08/31 17:42:34 millert Exp $ */
/* $NetBSD: mem.c,v 1.6 1995/04/10 11:55:03 mycroft Exp $ */
/*
@@ -74,7 +74,16 @@ mmopen(dev, flag, mode)
dev_t dev;
int flag, mode;
{
- return (0);
+
+ switch (minor(dev)) {
+ case 0:
+ case 1:
+ case 2:
+ case 12:
+ return (0);
+ default:
+ return (ENXIO);
+ }
}
/*ARGSUSED*/
diff --git a/sys/arch/mvme68k/mvme68k/mem.c b/sys/arch/mvme68k/mvme68k/mem.c
index 49c9b1c49f8..c078c29e414 100644
--- a/sys/arch/mvme68k/mvme68k/mem.c
+++ b/sys/arch/mvme68k/mvme68k/mem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mem.c,v 1.5 1997/02/10 11:39:26 downsj Exp $ */
+/* $OpenBSD: mem.c,v 1.6 1998/08/31 17:42:35 millert Exp $ */
/*
* Copyright (c) 1995 Theo de Raadt
@@ -94,7 +94,15 @@ mmopen(dev, flag, mode)
int flag, mode;
{
- return (0);
+ switch (minor(dev)) {
+ case 0:
+ case 1:
+ case 2:
+ case 12:
+ return (0);
+ default:
+ return (ENXIO);
+ }
}
/*ARGSUSED*/
diff --git a/sys/arch/mvme88k/mvme88k/mem.c b/sys/arch/mvme88k/mvme88k/mem.c
index ac0aa635999..e177f2c8bb3 100644
--- a/sys/arch/mvme88k/mvme88k/mem.c
+++ b/sys/arch/mvme88k/mvme88k/mem.c
@@ -64,7 +64,15 @@ mmopen(dev, flag, mode)
int flag, mode;
{
- return (0);
+ switch (minor(dev)) {
+ case 0:
+ case 1:
+ case 2:
+ case 12:
+ return (0);
+ default:
+ return (ENXIO);
+ }
}
/*ARGSUSED*/
diff --git a/sys/arch/pmax/pmax/mem.c b/sys/arch/pmax/pmax/mem.c
index b228ee4c8eb..2a5e2e6c89f 100644
--- a/sys/arch/pmax/pmax/mem.c
+++ b/sys/arch/pmax/pmax/mem.c
@@ -68,7 +68,15 @@ mmopen(dev, flag, mode, p)
struct proc *p;
{
- return (0);
+ switch (minor(dev)) {
+ case 0:
+ case 1:
+ case 2:
+ case 12:
+ return (0);
+ default:
+ return (ENXIO);
+ }
}
/*ARGSUSED*/
diff --git a/sys/arch/powerpc/powerpc/mem.c b/sys/arch/powerpc/powerpc/mem.c
index 5633cc2cd48..e712f96c629 100644
--- a/sys/arch/powerpc/powerpc/mem.c
+++ b/sys/arch/powerpc/powerpc/mem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mem.c,v 1.2 1996/12/28 06:22:07 rahnds Exp $ */
+/* $OpenBSD: mem.c,v 1.3 1998/08/31 17:42:39 millert Exp $ */
/* $NetBSD: mem.c,v 1.1 1996/09/30 16:34:50 ws Exp $ */
/*
@@ -60,7 +60,16 @@ mmopen(dev, flag, mode)
dev_t dev;
int flag, mode;
{
- return 0;
+
+ switch (minor(dev)) {
+ case 0:
+ case 1:
+ case 2:
+ case 12:
+ return (0);
+ default:
+ return (ENXIO);
+ }
}
/*ARGSUSED*/
diff --git a/sys/arch/sparc/sparc/mem.c b/sys/arch/sparc/sparc/mem.c
index cd594c505a2..db56d9725cc 100644
--- a/sys/arch/sparc/sparc/mem.c
+++ b/sys/arch/sparc/sparc/mem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mem.c,v 1.3 1997/08/08 08:27:31 downsj Exp $ */
+/* $OpenBSD: mem.c,v 1.4 1998/08/31 17:42:41 millert Exp $ */
/* $NetBSD: mem.c,v 1.13 1996/03/30 21:12:16 christos Exp $ */
/*
@@ -71,7 +71,16 @@ mmopen(dev, flag, mode, p)
struct proc *p;
{
- return (0);
+ switch (minor(dev)) {
+ case 0:
+ case 1:
+ case 2:
+ case 11:
+ case 12:
+ return (0);
+ default:
+ return (ENXIO);
+ }
}
/*ARGSUSED*/
diff --git a/sys/arch/sun3/sun3/mem.c b/sys/arch/sun3/sun3/mem.c
index a8924da66b1..0fcec58ac60 100644
--- a/sys/arch/sun3/sun3/mem.c
+++ b/sys/arch/sun3/sun3/mem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mem.c,v 1.6 1997/02/10 11:53:11 downsj Exp $ */
+/* $OpenBSD: mem.c,v 1.7 1998/08/31 17:42:42 millert Exp $ */
/* $NetBSD: mem.c,v 1.19 1995/08/08 21:09:01 gwr Exp $ */
/*
@@ -78,7 +78,23 @@ mmopen(dev, flag, mode, p)
struct proc *p;
{
- return (0);
+ switch (minor(dev)) {
+ case 0:
+ case 1:
+ case 2:
+ case 5:
+ case 6:
+ case 7:
+ case 8:
+ case 9:
+ case 10:
+ case 11:
+ case 12:
+ case 13:
+ return (0);
+ default:
+ return (ENXIO);
+ }
}
/*ARGSUSED*/
diff --git a/sys/arch/vax/vax/mem.c b/sys/arch/vax/vax/mem.c
index 644c7285eff..43b85dd0290 100644
--- a/sys/arch/vax/vax/mem.c
+++ b/sys/arch/vax/vax/mem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mem.c,v 1.4 1997/05/29 00:05:23 niklas Exp $ */
+/* $OpenBSD: mem.c,v 1.5 1998/08/31 17:42:44 millert Exp $ */
/* $NetBSD: mem.c,v 1.9 1996/04/08 18:32:48 ragge Exp $ */
/*
@@ -74,7 +74,15 @@ mmopen(dev, flag, mode)
int flag, mode;
{
- return (0);
+ switch (minor(dev)) {
+ case 0:
+ case 1:
+ case 2:
+ case 12:
+ return (0);
+ default:
+ return (ENXIO);
+ }
}
/*ARGSUSED*/
diff --git a/sys/arch/wgrisc/wgrisc/mem.c b/sys/arch/wgrisc/wgrisc/mem.c
index 557bf234431..14d139939b6 100644
--- a/sys/arch/wgrisc/wgrisc/mem.c
+++ b/sys/arch/wgrisc/wgrisc/mem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mem.c,v 1.2 1997/02/16 22:31:28 pefo Exp $ */
+/* $OpenBSD: mem.c,v 1.3 1998/08/31 17:42:45 millert Exp $ */
/* $NetBSD: mem.c,v 1.6 1995/04/10 11:55:03 mycroft Exp $ */
/*
@@ -67,7 +67,16 @@ mmopen(dev, flag, mode)
int flag, mode;
{
- return (0);
+ switch (minor(dev)) {
+ case 0:
+ case 1:
+ case 2:
+ case 3:
+ case 12:
+ return (0);
+ default:
+ return (ENXIO);
+ }
}
/*ARGSUSED*/