CVE-2022-48740 selinux: fix double free of cond_list on error paths

High 7.8 Published Updated

A double free vulnerability in the Linux kernel SELinux module can cause a NULL pointer dereference, leading to a denial of service.

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-48740?

CVE-2022-48740 is a high-severity use after free vulnerability in Linux kernel, published on 20 Jun 2024. 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:

selinux: fix double free of cond_list on error paths

On error path from cond_read_list() and duplicate_policydb_cond_list() the cond_list_destroy() gets called a second time in caller functions, resulting in NULL pointer deref. Fix this by resetting the cond_list_len to 0 in cond_list_destroy(), making subsequent calls a noop.

Also consistently reset the cond_list pointer to NULL after freeing.

[PM: fix line lengths in the description]

Weakness: CWE-415

Which versions are affected by CVE-2022-48740?

It affects 1 product.

Products include Linux kernel.

How do I fix CVE-2022-48740?

Apply the vendor's patch.

Upgrade to the fixed version. These bugs are found with fuzzing and sanitisers and avoided by memory-safe languages. More about Use after free.

Is CVE-2022-48740 being exploited?

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

All Linux kernel vulnerabilities

Sources

Also known as DEBIAN-CVE-2022-48740, GHSA-f558-fw4f-vm2c, UBUNTU-CVE-2022-48740.

Is CVE-2022-48740 in your software?

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

Check your SBOMs for free