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

Medium 5.5 Published Updated

A memory leak in the Linux kernel AMD MCE driver can lead to resource exhaustion and denial of service when bank creation fails.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Local or same network only
Victim action needed
Not needed
Fix
Available

What is CVE-2022-49549?

CVE-2022-49549 is a medium-severity memory corruption vulnerability in Linux kernel, published on 26 Feb 2025. It can only be exploited from the same machine or local network, with no action from the victim.

Official 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. ]

Weakness: CWE-401

Which versions are affected by CVE-2022-49549?

It affects 1 product.

Products include Linux kernel.

How do I fix CVE-2022-49549?

Apply the vendor's patch.

Upgrade to the fixed version. Memory-safe languages, compiler hardening and fuzzing prevent most new cases. More about Memory corruption.

Is CVE-2022-49549 being exploited?

There is no known exploitation of CVE-2022-49549 in the wild and no public exploit code.

All Linux kernel vulnerabilities

Sources

Also known as DEBIAN-CVE-2022-49549, GHSA-2xf2-3hgg-m6f8, UBUNTU-CVE-2022-49549.

Is CVE-2022-49549 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free