[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen stable-4.18] x86/ucode: Extend AMD digest checks to cover Zen5 CPUs



commit 0b999cf7e7b5e857e20aee977cfd147925c34066
Author:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
AuthorDate: Tue Apr 8 17:09:15 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
CommitDate: Fri Apr 11 17:27:59 2025 +0100

    x86/ucode: Extend AMD digest checks to cover Zen5 CPUs
    
    AMD have updated the SB-7033 advisory to include Zen5 CPUs.  Extend the 
digest
    check to cover Zen5 too.
    
    In practice, cover everything until further notice.
    
    Observant readers may be wondering where the update to the digest list is.  
At
    the time of writing, no Zen5 patches are available via a verifiable channel.
    
    Link: 
https://www.amd.com/en/resources/product-security/bulletin/amd-sb-7033.html
    Fixes: 630e8875ab36 ("x86/ucode: Perform extra SHA2 checks on AMD 
Fam17h/19h microcode")
    Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
    Reviewed-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
    (cherry picked from commit b63951467e964bcc927f823fc943e40069fac0c9)
    
    x86/ucode: Extend warning about disabling digest check too
    
    This was missed by accident.
    
    Fixes: b63951467e96 ("x86/ucode: Extend AMD digest checks to cover Zen5 
CPUs")
    Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
    Reviewed-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
    (cherry picked from commit 59bb316ea89e7f9461690fe00547d7d2af96321d)
---
 xen/arch/x86/cpu/microcode/amd.c  | 8 ++++++--
 xen/arch/x86/cpu/microcode/core.c | 2 +-
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/cpu/microcode/amd.c b/xen/arch/x86/cpu/microcode/amd.c
index b5c2a55b26..48466403ba 100644
--- a/xen/arch/x86/cpu/microcode/amd.c
+++ b/xen/arch/x86/cpu/microcode/amd.c
@@ -118,8 +118,12 @@ static bool check_digest(const struct container_microcode 
*mc)
     const struct patch_digest *pd;
     uint8_t digest[SHA2_256_DIGEST_SIZE];
 
-    /* Only Fam17h/19h are known to need extra checks.  Skip other families. */
-    if ( boot_cpu_data.x86 < 0x17 || boot_cpu_data.x86 > 0x19 ||
+    /*
+     * Zen1 thru Zen5 CPUs are known to use a weak signature algorithm on
+     * microcode updates.  Mitigate by checking the digest of the patch
+     * against a list of known provenance.
+     */
+    if ( boot_cpu_data.x86 < 0x17 ||
          !opt_digest_check )
         return true;
 
diff --git a/xen/arch/x86/cpu/microcode/core.c 
b/xen/arch/x86/cpu/microcode/core.c
index fa92355a7e..fce38404d5 100644
--- a/xen/arch/x86/cpu/microcode/core.c
+++ b/xen/arch/x86/cpu/microcode/core.c
@@ -871,7 +871,7 @@ int __init early_microcode_init(unsigned long *module_map,
     {
     case X86_VENDOR_AMD:
         if ( !opt_digest_check &&
-             boot_cpu_data.x86 >= 0x17 && boot_cpu_data.x86 <= 0x19 )
+             boot_cpu_data.x86 >= 0x17 )
         {
             printk(XENLOG_WARNING
                    "Microcode patch additional digest checks disabled");
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.18



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.