# CVE-2022-49549: x86/MCE/AMD: Fix memory leak when threshold_create_bank() fails

- Severity: Medium 5.5 (CVSS:3.1, scored by CISA-ADP) `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.27%, higher than 20% of CVEs (2026-12-01)
- Published: 2025-02-26T02:14:00.256Z
- Modified: 2026-06-17T05:18:25.043Z
- 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:

x86/MCE/AMD: Fix memory leak when threshold_create_bank() fails

In mce_threshold_create_device(), if threshold_create_bank() fails, the
previously allocated threshold banks array @bp will be leaked because
the call to mce_threshold_remove_device() will not free it.

This happens because mce_threshold_remove_device() fetches the pointer
through the threshold_banks per-CPU variable but bp is written there
only after the bank creation is successful, and not before, when
threshold_create_bank() fails.

Add a helper which unwinds all the bank creation work previously done
and pass into it the previously allocated threshold banks array for
freeing.

  [ bp: Massage. ]

(As written by CVE List.)

## Affected

- Linux Linux: from 6458de97fc15530b54477c4e2b70af653e8ac3d9 before b4acb8e7f1594607bc9017ef0aacb40b24a003d6; from 6458de97fc15530b54477c4e2b70af653e8ac3d9 before cc0dd4456f9573bf8af9b4d8754433918e809e1e; from 6458de97fc15530b54477c4e2b70af653e8ac3d9 before 9708f1956eeb70c86943e0bc62fa3b0101b59616; from 6458de97fc15530b54477c4e2b70af653e8ac3d9 before 396b8e7ab2a99ddac57d3522b3da5e58cb608d37; from 6458de97fc15530b54477c4e2b70af653e8ac3d9 before e5f28623ceb103e13fc3d7bd45edf9818b227fd0; 5.8 (not affected: before 5.8; from 5.10.121 up to 5.10.*; from 5.15.46 up to 5.15.*; from 5.17.14 up to 5.17.*; from 5.18.3 up to 5.18.*; from 5.19 up to *)
- linux linux_kernel: from 5.8 before 5.10.121; from 5.11 before 5.15.46; from 5.16 before 5.17.14; from 5.18 before 5.18.3

## Every score

- CISA-ADP: CVSS:3.1 5.5 Medium `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- NVD: CVSS:3.1 5.5 Medium `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`

## References

- <https://git.kernel.org/stable/c/b4acb8e7f1594607bc9017ef0aacb40b24a003d6> (patch)
- <https://git.kernel.org/stable/c/cc0dd4456f9573bf8af9b4d8754433918e809e1e> (patch)
- <https://git.kernel.org/stable/c/9708f1956eeb70c86943e0bc62fa3b0101b59616> (patch)
- <https://git.kernel.org/stable/c/396b8e7ab2a99ddac57d3522b3da5e58cb608d37> (patch)
- <https://git.kernel.org/stable/c/e5f28623ceb103e13fc3d7bd45edf9818b227fd0> (patch)

## Sources

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

---

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