{"id":"CVE-2022-49549","summary":"x86/MCE/AMD: Fix memory leak when threshold_create_bank() fails","details":"In the Linux kernel, the following vulnerability has been resolved:\n\nx86/MCE/AMD: Fix memory leak when threshold_create_bank() fails\n\nIn mce_threshold_create_device(), if threshold_create_bank() fails, the\npreviously allocated threshold banks array @bp will be leaked because\nthe call to mce_threshold_remove_device() will not free it.\n\nThis happens because mce_threshold_remove_device() fetches the pointer\nthrough the threshold_banks per-CPU variable but bp is written there\nonly after the bank creation is successful, and not before, when\nthreshold_create_bank() fails.\n\nAdd a helper which unwinds all the bank creation work previously done\nand pass into it the previously allocated threshold banks array for\nfreeing.\n\n  [ bp: Massage. ]","modified":"2026-04-02T08:27:42.032325Z","published":"2025-02-26T02:14:00.256Z","related":["SUSE-SU-2025:1027-1","SUSE-SU-2025:1176-1","SUSE-SU-2025:1183-1","SUSE-SU-2025:1241-1"],"database_specific":{"osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/49xxx/CVE-2022-49549.json","cna_assigner":"Linux"},"references":[{"type":"WEB","url":"https://git.kernel.org/stable/c/396b8e7ab2a99ddac57d3522b3da5e58cb608d37"},{"type":"WEB","url":"https://git.kernel.org/stable/c/9708f1956eeb70c86943e0bc62fa3b0101b59616"},{"type":"WEB","url":"https://git.kernel.org/stable/c/b4acb8e7f1594607bc9017ef0aacb40b24a003d6"},{"type":"WEB","url":"https://git.kernel.org/stable/c/cc0dd4456f9573bf8af9b4d8754433918e809e1e"},{"type":"WEB","url":"https://git.kernel.org/stable/c/e5f28623ceb103e13fc3d7bd45edf9818b227fd0"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/49xxx/CVE-2022-49549.json"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-49549"},{"type":"PACKAGE","url":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"6458de97fc15530b54477c4e2b70af653e8ac3d9"},{"fixed":"b4acb8e7f1594607bc9017ef0aacb40b24a003d6"},{"fixed":"cc0dd4456f9573bf8af9b4d8754433918e809e1e"},{"fixed":"9708f1956eeb70c86943e0bc62fa3b0101b59616"},{"fixed":"396b8e7ab2a99ddac57d3522b3da5e58cb608d37"},{"fixed":"e5f28623ceb103e13fc3d7bd45edf9818b227fd0"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-49549.json"}}],"schema_version":"1.7.5","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H"}]}