News: 0001584243

  ARM Give a man a fire and he's warm for a day, but set fire to him and he's warm for the rest of his life (Terry Pratchett, Jingo)

AMD Dev Proposes Dynamic Mitigations For Linux: Run-Time Toggling Of CPU Mitigations

([Linux Security] 3 Hours Ago Linux Dynamic Mitigations)


A big patch series was posted today for the Linux kernel that would allow enabling/disabling CPU security mitigations at run-time rather than the current handling that can only be managed at boot-time via various Linux kernel command-line arguments. Thus due to changing security needs, differing workloads mandating different CPU security concerns and the like, this proposed feature would allow Spectre, Meltdown, and other CPU security mitigations to all be toggled at run-time.

AMD engineer David Kaplan who recently wrapped up work on the [1]Attack Vector Controls for the Linux kernel has next turned his attention to Dynamic Mitigations: the ability to enable/disable CPU security mitigations at run-time without needing a reboot or Kexec'ing to a new kernel.

To overcome the limitation of only being able to change CPU security mitigations at boot time, the patches sent out today under a "request for comments" would allow writing the CPU security mitigation option values to /sys/devices/system/cpu/mitigations . For example, echo "mitigations=off" > /sys/devices/system/cpu/mitigations to disable all the CPU security mitigations or other existing kernel boot argument values like "spectre_v2=retpoline tsa=off" to this new sysfs mitigations file.

"As the performance cost of CPU mitigations can be significant, selecting the right set of mitigations is important to achieve the correct balance of performance/security."

Among the intended use-cases are for better run-time policy handling, changing mitigations as a result of new CPU security findings but without having to reboot the systems/servers, quick mitigation testing to avoid to reboot, etc.

AMD's David Kaplan went on to explain how this run-time patching of the kernel is handled for the mitigations:

"Re-patching the kernel is expected to be a very rare operation and is done under very big hammers. All tasks are put into the freezer and the re-patching is then done under the (new) stop_machine_nmi() routine.

To re-patch the kernel, it is first reverted back to its compile-time state. The original bytes from alternatives, retpolines, etc. are saved during boot so they can later be used to restore the original kernel image. After that, the kernel is patched based on the new feature flags.

This simplifies the re-patch process as restoring the original kernel image is relatively straightforward. In other words, instead of having to re-patch from mitigation A to mitigation B directly, we first restore the original image and then patch from that to mitigation B, similar to if the system had booted with mitigation B selected originally."

Kaplan observed the run-time re-patching of the kernel to take around 50 ms.

Those interested in the big 56 patch RFC series can find the proposed Dynamic Mitigations code on [2]the Linux kernel mailing list .



[1] https://www.phoronix.com/search/Attack+Vector+Controls

[2] https://lore.kernel.org/lkml/20251013143444.3999-1-david.kaplan@amd.com/



Tux Penguin Boxing Match

LAS VEGAS, NV -- The unofficial Linux mascot Tux the Penguin will face his arch
rival the BSD Daemon in a boxing match this Saturday night. The match is part
of the International Computer Mascot Boxing Federation's First Annual World
Championship Series. The winner will advance to face one of the Intel "Bunny
People".

Boxing pundits favor Tux as the winner. Last week Tux won his first match in
the Championship Series against Wilbur the Gimp. "The Gimp didn't have a
chance," one spectator said. "With Tux's ability to run at top speeds of over
100mph, I don't see how he could possibly lose." The BSD Daemon, however, is
certainly a formidible opponent. While boxing rules prohibit the Daemon from
using his patented pitchfork, his pointy horns are permitted in the ring.

Some observers think the whole Computer Mascot Boxing Federation is a fake.
"WWF is all scripted," one sports writer pointed out. "And so is this. You
actually think that a penguin is capable of boxing? The idea of a penguin
fighting a demon is patently absurd. This whole Championship Series has no
doubt been scripted. It's probably nothing more than two little kids in
penguin and demon suits duking it out in a boxing ring. What a waste of time."