summaryrefslogtreecommitdiffstats
path: root/sys/arch/hppa/hppa/mem.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/arch/hppa/hppa/mem.c')
-rw-r--r--sys/arch/hppa/hppa/mem.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/sys/arch/hppa/hppa/mem.c b/sys/arch/hppa/hppa/mem.c
index 6b43cccb6e3..94984bdc47a 100644
--- a/sys/arch/hppa/hppa/mem.c
+++ b/sys/arch/hppa/hppa/mem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mem.c,v 1.1 2016/08/19 20:48:36 tedu Exp $ */
+/* $OpenBSD: mem.c,v 1.2 2016/09/25 15:23:37 deraadt Exp $ */
/*
* Copyright (c) 1998-2004 Michael Shalayeff
@@ -302,6 +302,20 @@ viper_eisa_en(void)
int
mmopen(dev_t dev, int flag, int ioflag, struct proc *p)
{
+ extern int allowkmem;
+
+ switch (minor(dev)) {
+ case 0:
+ case 1:
+ if (securelevel <= 0 || allowkmem)
+ break;
+ return (EPERM);
+ case 2:
+ case 12:
+ break;
+ default:
+ return (ENXIO);
+ }
return (0);
}