CVE-2022-50855 bpf: prevent leak of lsm program after failed attach

Not scored Published Updated

A local attacker with high privileges can trigger a reference count leak in the Linux kernel BPF LSM subsystem, potentially leading to privilege escalation or denial of service.

Exploited in the wild
Not known
Login needed
An administrator
Attackable
Local or same network only
Victim action needed
Not needed
Fix
Available

What is CVE-2022-50855?

CVE-2022-50855 is a memory corruption vulnerability in Linux, published on 30 Dec 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:

bpf: prevent leak of lsm program after failed attach

In [0], we added the ability to bpf_prog_attach LSM programs to cgroups, but in our validation to make sure the prog is meant to be attached to BPF_LSM_CGROUP, we return too early if the check fails. This results in lack of decrementing prog's refcnt (through bpf_prog_put) leaving the LSM program alive past the point of the expected lifecycle. This fix allows for the decrement to take place.

[0] https://lore.kernel.org/all/[email protected]/

Which versions are affected by CVE-2022-50855?

How do I fix CVE-2022-50855?

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-50855 being exploited?

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

Sources

Also known as DEBIAN-CVE-2022-50855, GHSA-www3-7cx8-9832, UBUNTU-CVE-2022-50855.

Is CVE-2022-50855 in your software?

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

Check your SBOMs for free