Update the list of cpudev ioctls which require write access.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
This commit is contained in:
Konstantin Belousov 2017-03-19 21:25:27 +00:00
parent 9abc1e2b0c
commit 133cbe3b59
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=315588

View File

@ -156,8 +156,9 @@ cpuctl_ioctl(struct cdev *dev, u_long cmd, caddr_t data,
return (ENXIO);
}
/* Require write flag for "write" requests. */
if ((cmd == CPUCTL_WRMSR || cmd == CPUCTL_UPDATE) &&
((flags & FWRITE) == 0))
if ((cmd == CPUCTL_MSRCBIT || cmd == CPUCTL_MSRSBIT ||
cmd == CPUCTL_UPDATE || cmd == CPUCTL_WRMSR) &&
(flags & FWRITE) == 0)
return (EPERM);
switch (cmd) {
case CPUCTL_RDMSR: