CVE-2026-23159 perf: sched: Fix perf crash with new is_user_task() helper

Medium 5.5 Published Updated

A race condition in the Linux kernel perf subsystem can cause a null pointer dereference crash when profiling tasks during exit.

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-2026-23159?

CVE-2026-23159 is a medium-severity vulnerability in Linux kernel, published on 14 Feb 2026. 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:

perf: sched: Fix perf crash with new is_user_task() helper

In order to do a user space stacktrace the current task needs to be a user task that has executed in user space. It use to be possible to test if a task is a user task or not by simply checking the task_struct mm field. If it was non NULL, it was a user task and if not it was a kernel task.

But things have changed over time, and some kernel tasks now have their own mm field.

An idea was made to instead test PF_KTHREAD and two functions were used to wrap this check in case it became more complex to test if a task was a user task or not[1]. But this was rejected and the C code simply checked the PF_KTHREAD directly.

It was later found that not all kernel threads set PF_KTHREAD. The io-uring helpers instead set PF_USER_WORKER and this needed to be added as well.

But checking the flags is still not enough. There's a very small window when a task exits that it frees its mm field and it is set back to NULL. If perf were to trigger at this moment, the flags test would say its a user space task but when perf would read the mm field it would crash with at NULL pointer dereference.

Now there are flags that can be used to test if a task is exiting, but they are set in areas that perf may still want to profile the user space task (to see where it exited). The only real test is to check both the flags and the mm field.

Instead of making this modification in every location, create a new is_user_task() helper function that does all the tests needed to know if it is safe to read the user space memory or not.

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

Weakness: CWE-476

Which versions are affected by CVE-2026-23159?

It affects 1 product.

Products include Linux kernel.

How do I fix CVE-2026-23159?

Apply the vendor's patch.

Is CVE-2026-23159 being exploited?

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

All Linux kernel vulnerabilities

Sources

Also known as BELL-CVE-2026-23159, DEBIAN-CVE-2026-23159, GHSA-398f-64gc-qxqm, ROOT-OS-UBUNTU-2404-CVE-2026-23159, UBUNTU-CVE-2026-23159.

Is CVE-2026-23159 in your software?

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

Check your SBOMs for free