Commit d23d33ea authored by Borislav Petkov's avatar Borislav Petkov Committed by Thomas Gleixner

x86/microcode: Taint and warn on late loading

Warn before it is attempted and taint the kernel. Late loading microcode
can lead to malfunction of the kernel when the microcode update changes
behaviour. There is no way for the kernel to determine whether its safe or
not.
Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/20220525161232.14924-4-bp@alien8.de
parent a77a94f8
...@@ -493,6 +493,9 @@ static int microcode_reload_late(void) ...@@ -493,6 +493,9 @@ static int microcode_reload_late(void)
{ {
int ret; int ret;
pr_err("Attempting late microcode loading - it is dangerous and taints the kernel.\n");
pr_err("You should switch to early loading, if possible.\n");
atomic_set(&late_cpus_in, 0); atomic_set(&late_cpus_in, 0);
atomic_set(&late_cpus_out, 0); atomic_set(&late_cpus_out, 0);
...@@ -541,6 +544,8 @@ static ssize_t reload_store(struct device *dev, ...@@ -541,6 +544,8 @@ static ssize_t reload_store(struct device *dev,
if (ret == 0) if (ret == 0)
ret = size; ret = size;
add_taint(TAINT_CPU_OUT_OF_SPEC, LOCKDEP_STILL_OK);
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment