CVE-2026-138827: platform/x86/amd: hfi: Fix out-of-bounds reads when parsing ranking data
In the Linux kernel, the following vulnerability has been resolved:
platform/x86/amd: hfi: Fix out-of-bounds reads when parsing ranking data
amdhfifillmetadata() parses CPU core ranking data out of the firmware-provided PCC shared memory but trusts two values it should not:
- nbitmaps is used to bound the outer loop that reads the APIC ID bitmaps from tabledata[], but it is never validated against the size of the shared memory region (pcctext->length). A firmware-supplied count larger than the region reads past the end of tabledata.
- When resolving the base of the ranking data for a processor, the pointer is shifted by an extra "i nrclass" term, where i is the current bitmap index. The per-processor offset is already applied through apicindex, which uses the running count of active processors (apicstart). The extra shift compounds for every logical processor beyond the first bitmap (APIC ID >= 32), reading out of bounds.
Both result in out-of-bounds reads that can corrupt the ranking metrics, oops, or otherwise destabilise the system.
Reject an nbitmaps value that would not fit within the shared memory region, and drop the bogus "i nrclass" term so the ranking data is addressed only through its correct per-processor offset.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.18.63 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 7.3.4 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 7.3.4-1 - Compensating control
In amd_hfi_fill_metadata(), validate that firmware-provided n_bitmaps fits within the shared memory region (pcct_ext->length), and remove the extra i * nr_class term from the ranking-data pointer calculation so the per-processor offset is applied only once.
Event History
Frequently Asked Questions
Which systems are in scope?
The issue is in the Linux kernel's platform/x86/amd HFI code when it parses CPU core ranking data from firmware-provided PCC shared memory. The provided information does not identify affected kernel versions or specific hardware models.
Are fix commits available for backport verification?
The references identify fixes at stable commit IDs 70ef07bf84276694597697c17d439c945084fe61, 2a70ce6a31689b3c4c1b6ffba81742a0c6336d35, and b7b273844b94af9cc64907dccd9e7997c2b60f1a.