diff --git a/sys/alpha/alpha/mem.c b/sys/alpha/alpha/mem.c index 13bbeb1fa23a..8e751138c195 100644 --- a/sys/alpha/alpha/mem.c +++ b/sys/alpha/alpha/mem.c @@ -116,12 +116,16 @@ mmclose(dev_t dev, int flags, int fmt, struct thread *td) static int mmopen(dev_t dev, int flags, int fmt, struct thread *td) { + int error; switch (minor(dev)) { case 0: case 1: - if ((flags & FWRITE) && securelevel > 0) - return (EPERM); + if (flags & FWRITE) { + error = securelevel_gt(td->td_proc->p_ucred, 0); + if (error) + return (error); + } break; case 32: #ifdef PERFMON diff --git a/sys/alpha/alpha/sys_machdep.c b/sys/alpha/alpha/sys_machdep.c index 0d304cbaad09..939289a14e74 100644 --- a/sys/alpha/alpha/sys_machdep.c +++ b/sys/alpha/alpha/sys_machdep.c @@ -114,8 +114,9 @@ alpha_sethae(struct thread *td, char *args) if (error) return (error); - if (securelevel > 0) - return (EPERM); + error = securelevel_gt(td->td_proc->p_ucred, 0); + if (error) + return (error); error = suser(td->td_proc); if (error)