{"id":"CVE-2026-138827","summary":"platform/x86/amd: hfi: Fix out-of-bounds reads when parsing ranking data","details":"In the Linux kernel, the following vulnerability has been resolved:\n\nplatform/x86/amd: hfi: Fix out-of-bounds reads when parsing ranking data\n\namd_hfi_fill_metadata() parses CPU core ranking data out of the\nfirmware-provided PCC shared memory but trusts two values it should not:\n\n - n_bitmaps is used to bound the outer loop that reads the APIC ID\n   bitmaps from table_data[], but it is never validated against the size\n   of the shared memory region (pcct_ext-\u003elength).  A firmware-supplied\n   count larger than the region reads past the end of table_data.\n\n - When resolving the base of the ranking data for a processor, the\n   pointer is shifted by an extra \"i * nr_class\" term, where i is the\n   current bitmap index.  The per-processor offset is already applied\n   through apic_index, which uses the running count of active processors\n   (apic_start).  The extra shift compounds for every logical processor\n   beyond the first bitmap (APIC ID \u003e= 32), reading out of bounds.\n\nBoth result in out-of-bounds reads that can corrupt the ranking metrics,\noops, or otherwise destabilise the system.\n\nReject an n_bitmaps value that would not fit within the shared memory\nregion, and drop the bogus \"i * nr_class\" term so the ranking data is\naddressed only through its correct per-processor offset.","modified":"2026-11-30T15:01:03.951126529Z","published":"2026-11-30T13:25:21.287Z","database_specific":{"osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/138xxx/CVE-2026-138827.json","cna_assigner":"Linux"},"references":[{"type":"PACKAGE","url":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"},{"type":"WEB","url":"https://git.kernel.org/stable/c/2a70ce6a31689b3c4c1b6ffba81742a0c6336d35"},{"type":"WEB","url":"https://git.kernel.org/stable/c/70ef07bf84276694597697c17d439c945084fe61"},{"type":"WEB","url":"https://git.kernel.org/stable/c/b7b273844b94af9cc64907dccd9e7997c2b60f1a"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/138xxx/CVE-2026-138827.json"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-138827"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"d4e95ea7a78e46be2f2fe529fe578d3834c453a2"},{"fixed":"70ef07bf84276694597697c17d439c945084fe61"},{"fixed":"2a70ce6a31689b3c4c1b6ffba81742a0c6336d35"},{"fixed":"b7b273844b94af9cc64907dccd9e7997c2b60f1a"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-138827.json"}},{"package":{"name":"Kernel","ecosystem":"Linux"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"6.17.0"},{"fixed":"6.18.63"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.19.0"},{"fixed":"7.3.4"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-138827.json"}}],"schema_version":"1.9.2"}