CVE-2022-50095 posix-cpu-timers: Cleanup CPU timers before freeing them during exec

High 7.8 Published Updated

A use-after-free in the Linux kernel posix-cpu-timers allows local attackers to execute arbitrary code or escalate privileges via a race condition during execve.

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

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

posix-cpu-timers: Cleanup CPU timers before freeing them during exec

Commit 55e8c8eb2c7b ("posix-cpu-timers: Store a reference to a pid not a task") started looking up tasks by PID when deleting a CPU timer.

When a non-leader thread calls execve, it will switch PIDs with the leader process. Then, as it calls exit_itimers, posix_cpu_timer_del cannot find the task because the timer still points out to the old PID.

That means that armed timers won't be disarmed, that is, they won't be removed from the timerqueue_list. exit_itimers will still release their memory, and when that list is later processed, it leads to a use-after-free.

Clean up the timers from the de-threaded task before freeing them. This prevents a reported use-after-free.

Weakness: CWE-416

Which versions are affected by CVE-2022-50095?

It affects 1 product.

Products include Linux kernel.

How do I fix CVE-2022-50095?

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

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

All Linux kernel vulnerabilities

Sources

Also known as DEBIAN-CVE-2022-50095, GHSA-99wc-552w-7m28, ROOT-OS-UBUNTU-2204-CVE-2022-50095, UBUNTU-CVE-2022-50095.

Is CVE-2022-50095 in your software?

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

Check your SBOMs for free