summaryrefslogtreecommitdiff
path: root/sys/arch/m88k
diff options
context:
space:
mode:
Diffstat (limited to 'sys/arch/m88k')
-rw-r--r--sys/arch/m88k/m88k/mem.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/sys/arch/m88k/m88k/mem.c b/sys/arch/m88k/m88k/mem.c
index ff057b58b04..93167c253ab 100644
--- a/sys/arch/m88k/m88k/mem.c
+++ b/sys/arch/m88k/m88k/mem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mem.c,v 1.4 2016/08/01 15:58:22 tedu Exp $ */
+/* $OpenBSD: mem.c,v 1.5 2016/09/25 15:23:37 deraadt Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -58,16 +58,21 @@ extern void *etext;
int
mmopen(dev_t dev, int flag, int mode, struct proc *p)
{
+ extern int allowkmem;
switch (minor(dev)) {
- case 0:
- case 1:
- case 2:
- case 12:
- return (0);
- default:
- return (ENXIO);
+ case 0:
+ case 1:
+ if (securelevel <= 0 || allowkmem)
+ break;
+ return (EPERM);
+ case 2:
+ case 12:
+ break;
+ default:
+ return (ENXIO);
}
+ return (0);
}
int