summaryrefslogtreecommitdiffstats
path: root/sys/compat/linux
diff options
context:
space:
mode:
authorkato <kato@FreeBSD.org>1997-10-30 10:53:30 +0000
committerkato <kato@FreeBSD.org>1997-10-30 10:53:30 +0000
commit44b39f89cb976b0fc9ca1befc794847428044cd6 (patch)
treef486126ed9a05531c98d0e9021e3fa734a138854 /sys/compat/linux
parent3c6a700f3139e1d5962a49fd7687c009ebc6f17b (diff)
downloadFreeBSD-src-44b39f89cb976b0fc9ca1befc794847428044cd6.zip
FreeBSD-src-44b39f89cb976b0fc9ca1befc794847428044cd6.tar.gz
Securelevel and formatting fixes, and trapframe simplification.
Reviewed by: sos Submitted by: bde
Diffstat (limited to 'sys/compat/linux')
-rw-r--r--sys/compat/linux/linux_misc.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c
index cc55b1e..8b40029 100644
--- a/sys/compat/linux/linux_misc.c
+++ b/sys/compat/linux/linux_misc.c
@@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: linux_misc.c,v 1.30 1997/09/21 21:43:45 gibbs Exp $
+ * $Id: linux_misc.c,v 1.31 1997/10/29 08:17:12 kato Exp $
*/
#include <sys/param.h>
@@ -52,7 +52,7 @@
#include <vm/vm_map.h>
#include <vm/vm_extern.h>
-#include <machine/cpu.h>
+#include <machine/frame.h>
#include <machine/psl.h>
#include <i386/linux/linux.h>
@@ -938,16 +938,15 @@ linux_getitimer(struct proc *p, struct linux_getitimer_args *args, int *retval)
int
linux_iopl(struct proc *p, struct linux_iopl_args *args, int *retval)
{
- int error;
- struct trapframe *fp;
+ int error;
error = suser(p->p_ucred, &p->p_acflag);
- if (error)
- return (error);
- fp = (struct trapframe *)p->p_md.md_regs;
- fp->tf_eflags |= PSL_IOPL;
-
- return 0;
+ if (error != 0)
+ return error;
+ if (securelevel > 0)
+ return EPERM;
+ p->p_md.md_regs->tf_eflags |= PSL_IOPL;
+ return 0;
}
int
OpenPOWER on IntegriCloud