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

Re: [PATCH v2 5/5] x86/ucode: Relax digest check when Entrysign is fixed in firmware


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 28 Oct 2025 10:47:19 +0100
  • Autocrypt: addr=jbeulich@xxxxxxxx; keydata= xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A nAuWpQkjM1ASeQwSHEeAWPgskBQL
  • Cc: Roger Pau Monné <roger.pau@xxxxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Tue, 28 Oct 2025 09:47:30 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 27.10.2025 23:17, Andrew Cooper wrote:
> When Entrysign has been mitigated in firwmare, it is believed to be safe to
> rely on the CPU patchloader again.  This avoids us needing to maintain the
> digest table for all new microcode indefinitely.
> 
> Relax the digest check when firmware looks to be up to date, and leave behind
> a clear message when not.
> 
> This is best-effort only.  If a malicious microcode has been loaded prior to
> Xen running, then all bets are off.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>

Like for patch 4, adjustments for Zen6 are then going to be needed here too,
aiui. May be worth repeating that statement here.

> @@ -603,3 +604,82 @@ static void __init __constructor 
> test_digests_sorted(void)
>      }
>  }
>  #endif /* CONFIG_SELF_TESTS */
> +
> +/*
> + * The Entrysign vulnerability affects all Zen1 thru Zen5 CPUs.  Firmware
> + * fixes were produced from Nov 2024.  Zen3 thru Zen5 can continue to take
> + * OS-loadable microcode updates using a new signature scheme, as long as
> + * firmware has been updated first.
> + */
> +void __init amd_check_entrysign(void)
> +{
> +    unsigned int curr_rev;
> +    uint8_t fixed_rev;
> +
> +    if ( boot_cpu_data.vendor != X86_VENDOR_AMD ||

Given the function name, might this check better live at the call site?

> +         boot_cpu_data.family < 0x17 ||
> +         boot_cpu_data.family > 0x1a )
> +        return;
> +
> +    /*
> +     * Table taken from Linux, which is the only known source of information
> +     * about client revisions.  Note, Linux expresses "last-vulnerable-rev"
> +     * while Xen wants "first-fixed-rev".
> +     */
> +    curr_rev = this_cpu(cpu_sig).rev;
> +    switch ( curr_rev >> 8 )
> +    {
> +    case 0x080012: fixed_rev = 0x78; break;
> +    case 0x080082: fixed_rev = 0x10; break;
> +    case 0x083010: fixed_rev = 0x7d; break;
> +    case 0x086001: fixed_rev = 0x0f; break;
> +    case 0x086081: fixed_rev = 0x09; break;
> +    case 0x087010: fixed_rev = 0x35; break;
> +    case 0x08a000: fixed_rev = 0x0b; break;
> +    case 0x0a0010: fixed_rev = 0x7b; break;
> +    case 0x0a0011: fixed_rev = 0xdb; break;
> +    case 0x0a0012: fixed_rev = 0x44; break;
> +    case 0x0a0082: fixed_rev = 0x0f; break;
> +    case 0x0a1011: fixed_rev = 0x54; break;
> +    case 0x0a1012: fixed_rev = 0x4f; break;
> +    case 0x0a1081: fixed_rev = 0x0a; break;
> +    case 0x0a2010: fixed_rev = 0x30; break;
> +    case 0x0a2012: fixed_rev = 0x13; break;
> +    case 0x0a4041: fixed_rev = 0x0a; break;
> +    case 0x0a5000: fixed_rev = 0x14; break;
> +    case 0x0a6012: fixed_rev = 0x0b; break;
> +    case 0x0a7041: fixed_rev = 0x0a; break;
> +    case 0x0a7052: fixed_rev = 0x09; break;
> +    case 0x0a7080: fixed_rev = 0x0a; break;
> +    case 0x0a70c0: fixed_rev = 0x0a; break;
> +    case 0x0aa001: fixed_rev = 0x17; break;
> +    case 0x0aa002: fixed_rev = 0x19; break;
> +    case 0x0b0021: fixed_rev = 0x47; break;
> +    case 0x0b1010: fixed_rev = 0x47; break;
> +    case 0x0b2040: fixed_rev = 0x32; break;
> +    case 0x0b4040: fixed_rev = 0x32; break;
> +    case 0x0b6000: fixed_rev = 0x32; break;
> +    case 0x0b7000: fixed_rev = 0x32; break;

Acked-by: Jan Beulich <jbeulich@xxxxxxxx>
(after cross checking with up-to-date Linux, i.e. including your recent
correction there)

Jan



 


Rackspace

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