diff options
author | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2006-01-05 20:09:19 +0000 |
---|---|---|
committer | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2006-01-05 20:09:19 +0000 |
commit | d429df0aff096c51788ed2b25364c5d1e13eeb20 (patch) | |
tree | a021b5f8982cfab59ab7d3837f6030d524ee77f7 /sys/arch/i386 | |
parent | 7068db9c11510ecad69b9f2a81ee8806cf76f645 (diff) |
Check securelevel and machdep.allowaperture for i386_set_ioperm() the
same way as for i386_iopl(). ok deraadt@
Diffstat (limited to 'sys/arch/i386')
-rw-r--r-- | sys/arch/i386/i386/sys_machdep.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/arch/i386/i386/sys_machdep.c b/sys/arch/i386/i386/sys_machdep.c index d423a40f040..1f4e026f0a4 100644 --- a/sys/arch/i386/i386/sys_machdep.c +++ b/sys/arch/i386/i386/sys_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sys_machdep.c,v 1.23 2004/02/01 12:26:45 grange Exp $ */ +/* $OpenBSD: sys_machdep.c,v 1.24 2006/01/05 20:09:18 matthieu Exp $ */ /* $NetBSD: sys_machdep.c,v 1.28 1996/05/03 19:42:29 christos Exp $ */ /*- @@ -394,6 +394,13 @@ i386_set_ioperm(p, args, retval) if ((error = suser(p, 0)) != 0) return error; +#ifdef APERTURE + if (!allowaperture && securelevel > 0) + return EPERM; +#else + if (securelevel > 0) + return EPERM; +#endif if ((error = copyin(args, &ua, sizeof(ua))) != 0) return (error); |