Skip to content

Commit d23d33e

Browse files
suryasaimadhuKAGA-KOKO
authored andcommitted
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: Borislav Petkov <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent a77a94f commit d23d33e

File tree

1 file changed

+5
-0
lines changed
  • arch/x86/kernel/cpu/microcode

1 file changed

+5
-0
lines changed

arch/x86/kernel/cpu/microcode/core.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -493,6 +493,9 @@ static int microcode_reload_late(void)
493493
{
494494
int ret;
495495

496+
pr_err("Attempting late microcode loading - it is dangerous and taints the kernel.\n");
497+
pr_err("You should switch to early loading, if possible.\n");
498+
496499
atomic_set(&late_cpus_in, 0);
497500
atomic_set(&late_cpus_out, 0);
498501

@@ -541,6 +544,8 @@ static ssize_t reload_store(struct device *dev,
541544
if (ret == 0)
542545
ret = size;
543546

547+
add_taint(TAINT_CPU_OUT_OF_SPEC, LOCKDEP_STILL_OK);
548+
544549
return ret;
545550
}
546551

0 commit comments

Comments
 (0)