{"id":"CVE-2022-49436","aliases":["CVE-2022-49436"],"related":[],"kind":"vulnerability","state":"published","title":"powerpc/papr_scm: Fix leaking nvdimm_events_map elements","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\npowerpc/papr_scm: Fix leaking nvdimm_events_map elements\n\nRight now 'char *' elements allocated for individual 'stat_id' in\n'papr_scm_priv.nvdimm_events_map[]' during papr_scm_pmu_check_events(), get\nleaked in papr_scm_remove() and papr_scm_pmu_register(),\npapr_scm_pmu_check_events() error paths.\n\nAlso individual 'stat_id' arent NULL terminated 'char *' instead they are fixed\n8-byte sized identifiers. However papr_scm_pmu_register() assumes it to be a\nNULL terminated 'char *' and at other places it assumes it to be a\n'papr_scm_perf_stat.stat_id' sized string which is 8-byes in size.\n\nFix this by allocating the memory for papr_scm_priv.nvdimm_events_map to also\ninclude space for 'stat_id' entries. This is possible since number of available\nevents/stat_ids are known upfront. This saves some memory and one extra level of\nindirection from 'nvdimm_events_map' to 'stat_id'. Also rest of the code\ncan continue to call 'kfree(papr_scm_priv.nvdimm_events_map)' without needing to\niterate over the array and free up individual elements.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\npowerpc/papr_scm: Fix leaking nvdimm_events_map elements\n\nRight now 'char *' elements allocated for individual 'stat_id' in\n'papr_scm_priv.nvdimm_events_map[]' during papr_scm_pmu_check_events(), get\nleaked in papr_scm_remove() and papr_scm_pmu_register(),\npapr_scm_pmu_check_events() error paths.\n\nAlso individual 'stat_id' arent NULL terminated 'char *' instead they are fixed\n8-byte sized identifiers. However papr_scm_pmu_register() assumes it to be a\nNULL terminated 'char *' and at other places it assumes it to be a\n'papr_scm_perf_stat.stat_id' sized string which is 8-byes in size.\n\nFix this by allocating the memory for papr_scm_priv.nvdimm_events_map to also\ninclude space for 'stat_id' entries. This is possible since number of available\nevents/stat_ids are known upfront. This saves some memory and one extra level of\nindirection from 'nvdimm_events_map' to 'stat_id'. Also rest of the code\ncan continue to call 'kfree(papr_scm_priv.nvdimm_events_map)' without needing to\niterate over the array and free up individual elements.","source":"cvelist"},{"lang":"es","text":"En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: powerpc/papr_scm: Se soluciona la fuga de elementos nvdimm_events_map En este momento, los elementos 'char *' asignados para el individuo 'stat_id' en 'papr_scm_priv.nvdimm_events_map[]' durante papr_scm_pmu_check_events(), se filtran en las rutas de error papr_scm_remove() y papr_scm_pmu_register(), papr_scm_pmu_check_events(). Además, los 'stat_id' individuales no son 'char *' terminados en NULL, sino que son identificadores fijos de tamaño de 8 bytes. Sin embargo, papr_scm_pmu_register() asume que es un 'char *' terminado en NULL y en otros lugares asume que es una cadena de tamaño 'papr_scm_perf_stat.stat_id' que tiene un tamaño de 8 bytes. Solucione este problema asignando la memoria para papr_scm_priv.nvdimm_events_map para que también incluya espacio para las entradas 'stat_id'. Esto es posible ya que la cantidad de eventos/stat_id disponibles se conoce de antemano. Esto ahorra algo de memoria y un nivel adicional de indirección de 'nvdimm_events_map' a 'stat_id'. Además, el resto del código puede continuar llamando a 'kfree(papr_scm_priv.nvdimm_events_map)' sin necesidad de iterar sobre la matriz y liberar elementos individuales.","source":"nvd"}],"published":"2025-02-26T02:12:52.044Z","modified":"2026-11-05T20:17:06.233Z","severity":{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","score":5.5,"rating":"MEDIUM"},"severities":[{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","score":5.5,"rating":"MEDIUM"}],"cwes":["CWE-401"],"affected":[{"ranges":[{"type":"git","introduced":"4c08d4bbc089a95f3f38389c2b79dbc6ab24f10b","fixed":"b073096df4dec70d0436321b7093bad27ae91f9e","status":"affected"},{"type":"git","introduced":"4c08d4bbc089a95f3f38389c2b79dbc6ab24f10b","fixed":"0e0946e22f3665d27325d389ff45ade6e93f3678","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"5.18","status":"affected"},{"type":"semver","introduced":"0","fixed":"5.18","status":"unaffected"},{"type":"semver","introduced":"5.18.3","lastAffected":"5.18.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"5.19","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"status":"affected","introduced":"5.18","fixed":"5.18.3"}],"vendor":"linux","product":"linux_kernel","cpe":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://git.kernel.org/stable/c/b073096df4dec70d0436321b7093bad27ae91f9e","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/0e0946e22f3665d27325d389ff45ade6e93f3678","tags":["patch"],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-11-05T19:45:34.397Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2022-49436","url":"https://www.cve.org/CVERecord?id=CVE-2022-49436","licence":"CVE Terms of Use","modified":"2026-11-05T19:49:39.644Z"},{"source":"nvd","name":"NVD","id":"CVE-2022-49436","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-49436","licence":"Public domain","modified":"2026-11-05T20:17:06.233Z"}],"updatedAt":"2026-11-25T22:58:20.655Z","epss":{"score":0.00223,"percentile":0.13791,"date":"2026-12-02T12:00:21.000Z"}}