lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <174403118308.31282.8495809232181072693.tip-bot2@tip-bot2>
Date: Mon, 07 Apr 2025 13:06:23 -0000
From: "tip-bot2 for Boris Ostrovsky" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: Boris Ostrovsky <boris.ostrovsky@...cle.com>,
 "Borislav Petkov (AMD)" <bp@...en8.de>, x86@...nel.org,
 linux-kernel@...r.kernel.org
Subject: [tip: x86/microcode] x86/microcode/AMD: Clean the cache if update did
 not load microcode

The following commit has been merged into the x86/microcode branch of tip:

Commit-ID:     321550859f3bd64f547d0b4e9fbd97bd539ef47c
Gitweb:        https://git.kernel.org/tip/321550859f3bd64f547d0b4e9fbd97bd539ef47c
Author:        Boris Ostrovsky <boris.ostrovsky@...cle.com>
AuthorDate:    Thu, 27 Mar 2025 19:05:03 -04:00
Committer:     Borislav Petkov (AMD) <bp@...en8.de>
CommitterDate: Mon, 07 Apr 2025 14:46:56 +02:00

x86/microcode/AMD: Clean the cache if update did not load microcode

If microcode did not get loaded there is no reason to keep it in the cache.
Moreover, if loading failed it will not be possible to load an earlier version
of microcode since the failed revision will always be selected from the cache
on the next reload attempt.

Since the failed revisions is not easily available at this point just clean the
whole cache. It will be rebuilt later if needed.

Signed-off-by: Boris Ostrovsky <boris.ostrovsky@...cle.com>
Signed-off-by: Borislav Petkov (AMD) <bp@...en8.de>
Link: https://lore.kernel.org/r/20250327230503.1850368-3-boris.ostrovsky@oracle.com
---
 arch/x86/kernel/cpu/microcode/amd.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/arch/x86/kernel/cpu/microcode/amd.c b/arch/x86/kernel/cpu/microcode/amd.c
index b61028c..57bd61f 100644
--- a/arch/x86/kernel/cpu/microcode/amd.c
+++ b/arch/x86/kernel/cpu/microcode/amd.c
@@ -1171,11 +1171,18 @@ static void microcode_fini_cpu_amd(int cpu)
 	uci->mc = NULL;
 }
 
+static void finalize_late_load_amd(int result)
+{
+	if (result)
+		cleanup();
+}
+
 static struct microcode_ops microcode_amd_ops = {
 	.request_microcode_fw	= request_microcode_amd,
 	.collect_cpu_info	= collect_cpu_info_amd,
 	.apply_microcode	= apply_microcode_amd,
 	.microcode_fini_cpu	= microcode_fini_cpu_amd,
+	.finalize_late_load	= finalize_late_load_amd,
 	.nmi_safe		= true,
 };
 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ