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
This commit is contained in:
Robert Watson 2001-09-26 20:22:38 +00:00
parent ce3a32b6da
commit 41c42188c8
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=83981

View File

@ -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);