# CVE-2022-49436: powerpc/papr_scm: Fix leaking nvdimm_events_map elements

- Severity: Medium 5.5 (CVSS:3.1, scored by NVD) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.22%, higher than 13% of CVEs (2026-12-02)
- Published: 2025-02-26T02:12:52.044Z
- Modified: 2026-11-05T20:17:06.233Z
- Weaknesses: CWE-401
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: Linux

## Description

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

powerpc/papr_scm: Fix leaking nvdimm_events_map elements

Right now 'char *' elements allocated for individual 'stat_id' in
'papr_scm_priv.nvdimm_events_map[]' during papr_scm_pmu_check_events(), get
leaked in papr_scm_remove() and papr_scm_pmu_register(),
papr_scm_pmu_check_events() error paths.

Also individual 'stat_id' arent NULL terminated 'char *' instead they are fixed
8-byte sized identifiers. However papr_scm_pmu_register() assumes it to be a
NULL terminated 'char *' and at other places it assumes it to be a
'papr_scm_perf_stat.stat_id' sized string which is 8-byes in size.

Fix this by allocating the memory for papr_scm_priv.nvdimm_events_map to also
include space for 'stat_id' entries. This is possible since number of available
events/stat_ids are known upfront. This saves some memory and one extra level of
indirection from 'nvdimm_events_map' to 'stat_id'. Also rest of the code
can continue to call 'kfree(papr_scm_priv.nvdimm_events_map)' without needing to
iterate over the array and free up individual elements.

(As written by CVE List.)

## Affected

- Linux Linux: from 4c08d4bbc089a95f3f38389c2b79dbc6ab24f10b before b073096df4dec70d0436321b7093bad27ae91f9e; from 4c08d4bbc089a95f3f38389c2b79dbc6ab24f10b before 0e0946e22f3665d27325d389ff45ade6e93f3678; 5.18 (not affected: before 5.18; from 5.18.3 up to 5.18.*; from 5.19 up to *)
- linux linux_kernel: from 5.18 before 5.18.3

## References

- <https://git.kernel.org/stable/c/b073096df4dec70d0436321b7093bad27ae91f9e> (patch)
- <https://git.kernel.org/stable/c/0e0946e22f3665d27325d389ff45ade6e93f3678> (patch)

## Sources

- CVE List: [CVE-2022-49436](https://www.cve.org/CVERecord?id=CVE-2022-49436), CVE Terms of Use, modified 2026-11-05
- NVD: [CVE-2022-49436](https://nvd.nist.gov/vuln/detail/CVE-2022-49436), Public domain, modified 2026-11-05

---

Page: https://cve.day/CVE-2022-49436 · Whole record: https://cve.day/CVE-2022-49436.json · Rebuilt by cve.day 2026-11-25T22:58:20.655Z
