From d2bcf9062d3b26fdd3b5a0c0cbf1bda53512704e Mon Sep 17 00:00:00 2001 From: rwatson Date: Wed, 26 Sep 2001 20:22:38 +0000 Subject: [PATCH] o Modify access control checks in linux_iopl() to use securelevel_gt() rather than direct variable checks. (Yet another API to perform direct hardware I/O.) Obtained from: TrustedBSD Project --- sys/i386/linux/linux_machdep.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/i386/linux/linux_machdep.c b/sys/i386/linux/linux_machdep.c index ba443bb808f..7443aac125b 100644 --- a/sys/i386/linux/linux_machdep.c +++ b/sys/i386/linux/linux_machdep.c @@ -560,8 +560,8 @@ linux_iopl(struct thread *td, struct linux_iopl_args *args) return (EINVAL); if ((error = suser_td(td)) != 0) return (error); - if (securelevel > 0) - return (EPERM); + if ((error = securelevel_gt(td->td_proc->p_ucred, 0)) != 0) + return (error); td->td_frame->tf_eflags = (td->td_frame->tf_eflags & ~PSL_IOPL) | (args->level * (PSL_IOPL / 3)); return (0); -- 2.45.2