News for hackers. Stuff that matters.
Re:Linux to begin tightening up ability to write to CPU MSRs... by Wowfunhappy on Thursday June 25, 2020 @10:24AM (#23641097)
And also, because it's Linux, anyone who really needs this for some kind of niche reason can recompile the kernel, right?
Re:Linux to begin tightening up ability to write to CPU MSRs... by segfaultbuserr on Thursday June 25, 2020 @10:26AM (#23641120)
It's even better - you just need to change your boot parameters.

> This behavior right now can be toggled via the msr.allow_writes= kernel module paramrter with on/off/default. Should legitimate use-cases come up where writes to MSRs from user-space are still desired, they may add the infrastructure to selectively grant/deny access to specific MSRs and ensure they are sanitized by the kernel.

Similar hardware restrictions already exists in the kernel, for example, by default the kernel restricts access to I/O memory since it's a dangerous, low-level zone, but if you really need to for some reasons (e.g. reflash your BIOS), you can boot with "iomem=relaxed" to turn it off. Treating MSR registers in the same way is very reasonable.

Re:Linux to begin tightening up ability to write to CPU MSRs... by kinghajj on Thursday June 25, 2020 @05:56PM (#23646232)
Is there any clarification on how this MSR whitelisting will be implemented by end users? Or is there just going to be the global "allow_writes" parameters? I'd assume too that even with that parameter set to on, programs accessing the MSRs will still need the SYS_RAWIO capability.
Re:Linux to begin tightening up ability to write to CPU MSRs... by segfaultbuserr on Thursday June 25, 2020 @06:27PM (#23646486)
Not sure, but I believe root or equivalent (CAP_SYS_RAWIO) privilege is always needed to write MSR, nothing has changed here.
Re:Linux to begin tightening up ability to write to CPU MSRs... by Wowfunhappy on Thursday June 25, 2020 @10:41AM (#23641273)
Ah, perfect! That seems like exactly the right way to handle things.
Re:Linux to begin tightening up ability to write to CPU MSRs... by bserge on Thursday June 25, 2020 @10:39AM (#23641252)
Thank God for that (niche reason being fine grained performance and thermal management on inadequately cooled machines, which is... all of them :D)