[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <165398248872.4207.18184101421580014984.tip-bot2@tip-bot2>
Date: Tue, 31 May 2022 07:34:48 -0000
From: "tip-bot2 for Borislav Petkov" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: Borislav Petkov <bp@...e.de>, Thomas Gleixner <tglx@...utronix.de>,
x86@...nel.org, linux-kernel@...r.kernel.org
Subject: [tip: x86/microcode] x86/microcode: Taint and warn on late loading
The following commit has been merged into the x86/microcode branch of tip:
Commit-ID: d23d33ea0fcdc4bbb484990bf53867f99c63ccab
Gitweb: https://git.kernel.org/tip/d23d33ea0fcdc4bbb484990bf53867f99c63ccab
Author: Borislav Petkov <bp@...e.de>
AuthorDate: Wed, 25 May 2022 18:12:31 +02:00
Committer: Thomas Gleixner <tglx@...utronix.de>
CommitterDate: Tue, 31 May 2022 09:31:19 +02:00
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 <bp@...e.de>
Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
Link: https://lore.kernel.org/r/20220525161232.14924-4-bp@alien8.de
---
arch/x86/kernel/cpu/microcode/core.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/arch/x86/kernel/cpu/microcode/core.c b/arch/x86/kernel/cpu/microcode/core.c
index c717db6..801b44a 100644
--- a/arch/x86/kernel/cpu/microcode/core.c
+++ b/arch/x86/kernel/cpu/microcode/core.c
@@ -493,6 +493,9 @@ static int microcode_reload_late(void)
{
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_out, 0);
@@ -541,6 +544,8 @@ put:
if (ret == 0)
ret = size;
+ add_taint(TAINT_CPU_OUT_OF_SPEC, LOCKDEP_STILL_OK);
+
return ret;
}
Powered by blists - more mailing lists