CVE-2022-49873 bpf: Fix wrong reg type conversion in release_reference()

Medium 5.5 Published Updated

An unprivileged user can leak kernel pointers by exploiting a type conversion error in the eBPF verifier's reference release logic.

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

CVE-2022-49873 is a medium-severity vulnerability in Linux kernel, published on 1 May 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: Fix wrong reg type conversion in release_reference()

Some helper functions will allocate memory. To avoid memory leaks, the verifier requires the eBPF program to release these memories by calling the corresponding helper functions.

When a resource is released, all pointer registers corresponding to the resource should be invalidated. The verifier use release_references() to do this job, by apply __mark_reg_unknown() to each relevant register.

It will give these registers the type of SCALAR_VALUE. A register that will contain a pointer value at runtime, but of type SCALAR_VALUE, which may allow the unprivileged user to get a kernel pointer by storing this register into a map.

Using __mark_reg_not_init() while NOT allow_ptr_leaks can mitigate this problem.

Weakness: CWE-704

Which versions are affected by CVE-2022-49873?

It affects 1 product.

Products include Linux kernel.

How do I fix CVE-2022-49873?

Apply the vendor's patch.

Is CVE-2022-49873 being exploited?

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

All Linux kernel vulnerabilities

Sources

Also known as DEBIAN-CVE-2022-49873, GHSA-p59w-r597-mmwf, UBUNTU-CVE-2022-49873.

Is CVE-2022-49873 in your software?

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

Check your SBOMs for free