CVE-2025-21991: x86/microcode/AMD: Fix out-of-bounds on systems with CPU-less NUMA nodes

Published Apr 2, 2025
·
Updated

In the Linux kernel, the following vulnerability has been resolved:

x86/microcode/AMD: Fix out-of-bounds on systems with CPU-less NUMA nodes

Currently, loadmicrocodeamd() iterates over all NUMA nodes, retrieves their CPU masks and unconditionally accesses per-CPU data for the first CPU of each mask.

According to Documentation/admin-guide/mm/numaperf.rst:

"Some memory may share the same node as a CPU, and others are provided as memory only nodes."

Therefore, some node CPU masks may be empty and wouldn't have a "first CPU".

On a machine with far memory (and therefore CPU-less NUMA nodes): - cpumaskofnode(nid) is 0 - cpumaskfirst(0) is CONFIGNRCPUS - cpudata(CONFIGNRCPUS) accesses the cpuinfo per-CPU array at an index that is 1 out of bounds

This does not have any security implications since flashing microcode is a privileged operation but I believe this has reliability implications by potentially corrupting memory while flashing a microcode update.

When booting with CONFIGUBSANBOUNDS=y on an AMD machine that flashes a microcode update. I get the following splat:

UBSAN: array-index-out-of-bounds in arch/x86/kernel/cpu/microcode/amd.c:X:Y index 512 is out of range for type 'unsigned long[512]' [...] Call Trace: dumpstack ubsanhandleoutofbounds loadmicrocodeamd requestmicrocodeamd reloadstore kernfsfopwriteiter vfswrite ksyswrite dosyscall64 entrySYSCALL64afterhwframe

Change the loop to go over only NUMA nodes which have CPUs before determining whether the first CPU on the respective node needs microcode update.

[ bp: Massage commit message, fix typo. ]

Affected Software

22 affected componentsFixes available
Linux Linux kernel
Linux Linux kernel>=4.14.308<4.15
Linux Linux kernel>=4.19.276<4.20
Linux Linux kernel>=5.4.235<5.5
Linux Linux kernel>=5.10.173<5.11
Linux Linux kernel>=5.15.99<5.16
Linux Linux kernel>=6.1.16<6.1.132
Linux Linux kernel>=6.2.3<6.6.84
Linux Linux kernel>=6.7<6.12.20
Linux Linux kernel>=6.13<6.13.8
Linux Linux kernel=6.14-rc1
Linux Linux kernel=6.14-rc2
Linux Linux kernel=6.14-rc3
Linux Linux kernel=6.14-rc4
Linux Linux kernel=6.14-rc5
Linux Linux kernel=6.14-rc6
Microsoft cbl2 kernel 5.15.182.1-1
Microsoft cbl2 kernel 5.15.182.1-1
Microsoft azl3 kernel 6.6.85.1-2
Microsoft cbl2 kernel 5.15.180.1-1
Microsoft azl3 kernel 6.6.82.1-1
debian/linux
6.1.176-16.1.190-16.12.107-16.12.115-27.2.12-17.2.15-1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade Linux kernel x86/microcode/AMD to a version that resolves this vulnerability.

    Patch x86/microcode/AMD: Fix out-of-bounds on systems with CPU-less NUMA nodes
  2. Compensating control

    If you rely on boot-time microcode updates (request_microcode_amd/load_microcode_amd), ensure systems with CPU-less NUMA nodes are protected by disabling/avoiding the affected microcode update path until the kernel fix is applied, to prevent reliability/memory corruption during microcode flashing.

Event History

Apr 2, 2025
CVE Published
via MITRE·12:53 PM
Data Sourced
via MITRE·12:53 PM
Description
Data Sourced
via NVD·01:15 PM
RemedyDescriptionSeverityWeaknessAffected Software
Data Sourced
via Red Hat·02:02 PM
DescriptionSeverityAffected Software
May 5, 2025
Data Sourced
via Microsoft·07:00 AM
DescriptionSeverityWeaknessAffected Software

Parent advisories

This vulnerability appears in the following advisories.

Peer vulnerabilities

Found alongside the following vulnerabilities.

Frequently Asked Questions

1

What systems are affected by CVE-2025-21991?

CVE-2025-21991 affects Linux kernel versions that utilize x86 microcode on systems with CPU-less NUMA nodes.

2

What is the severity of CVE-2025-21991?

The severity of CVE-2025-21991 is classified as moderate due to potential out-of-bounds access.

3

How do I fix CVE-2025-21991?

To fix CVE-2025-21991, update to the latest stable version of the Linux kernel that includes the security patch.

4

What type of vulnerability is CVE-2025-21991?

CVE-2025-21991 is an out-of-bounds access vulnerability in the Linux kernel related to microcode handling.

5

Is CVE-2025-21991 a remote exploit?

CVE-2025-21991 is not classified as a remote exploit; it requires specific conditions related to CPU-less NUMA nodes.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203