mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-12-30 15:38:06 +01:00
Don't allow i/o operations for non-root users.
This commit is contained in:
parent
21e00296ec
commit
f2b0c6b282
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=11467
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user