Linux Continues Crackdown On User-Space Poking CPU MSRs
Written by Michael Larabel in Linux Kernel on 14 December 2020 at 08:07 PM EST. 20 Comments
LINUX KERNEL --
The Linux kernel this year has seen new safeguards and efforts aiming to have user-space reduce their arbitrary poking of CPU machine specific registers (MSRs) in the name of security and other handling concerns. That effort has continued on with the Linux 5.11 cycle.

Linux user-space software with administrative privileges can write to arbitrary CPU MSRs and that can cause problems for a host of reasons. Recent kernels have added the support for adding notifications when an unrecognized MSR write from user-space occurs along with an option to allow filtering of MSR writes.

With Linux 5.11 the x86/misc code has the latest in "the ongoing fight against windmills in an attempt to have user-space tools not poke at naked MSRs."

The user-space tools like cpupower and turbostat that are hosted within the kernel tree have been adapted to no longer directly poke the x86 energy performance bias (EPB) MSR. In this case the Energy Performance Bias has already been exposed via sysfs and so they should have already been using it rather than needlessly dealing with the MSR directly. In turn, writes to MSR_IA32_ENERGY_PERF_BIAS are now blocked as user-space should be using the existing sysfs interface.

The MSR write filtering error messages printed to dmesg when such a write is attempted also now points users to this documentation.
Related News
About The Author
Author picture

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter or contacted via MichaelLarabel.com.

Popular News This Week