From f2b0c6b282472c888c91951aa0ad49b6d1ae40fd Mon Sep 17 00:00:00 2001 From: Bruce Evans Date: Sat, 14 Oct 1995 07:09:58 +0000 Subject: [PATCH] Don't allow i/o operations for non-root users. --- sys/i386/isa/spigot.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/i386/isa/spigot.c b/sys/i386/isa/spigot.c index 2c53e46a94b6..5f273844231a 100644 --- a/sys/i386/isa/spigot.c +++ b/sys/i386/isa/spigot.c @@ -207,6 +207,7 @@ struct spigot_softc *ss = (struct spigot_softc *)&spigot_softc[UNIT(dev)]; int spigot_ioctl(dev_t dev, int cmd, caddr_t data, int flag, struct proc *p) { +int error; struct spigot_softc *ss = (struct spigot_softc *)&spigot_softc[UNIT(dev)]; struct trapframe *fp; struct spigot_info *info; @@ -218,6 +219,9 @@ struct spigot_info *info; ss->signal_num = *((int *)data); break; case SPIGOT_IOPL_ON: /* allow access to the IO PAGE */ + error = suser(p->p_ucred, &p->p_acflag); + if (error != 0) + return error; fp=(struct trapframe *)p->p_md.md_regs; fp->tf_eflags |= PSL_IOPL; break;